Project

General

Profile

Actions

Feature #67418

open
LF LF

balancer: incorporate "upmap-remapped / pgremapper" logic with the balancer mgr module

Feature #67418: balancer: incorporate "upmap-remapped / pgremapper" logic with the balancer mgr module

Added by Laura Flores over 2 years ago. Updated 3 months ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
balancer module
Target version:
-
Due date:
% Done:

50%

Source:
Backport:
Reviewed:
Affected Versions:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

Motivation

The "upmap-remapped" [1] and "pgremapper" [2] tools have long been useful in the Ceph community as a workaround to cases where clusters experience a large percentage of misplaced objects due to adding osds/hosts or draining a host, and similar use cases.

The following scenario demonstrates one case where the upmap-remapped tool is used as a workaround in the community:

1. A user adds osds/hosts to the cluster OR drains a host (set crush weight to 0.01 or a similar small value).
2. The cluster experiences a high percentage of misplaced objects. PGs are remapped and backfilling or remapped and backfill_wait.
- If the % of misplaced objects exceeds "target_max_misplaced_ratio", the balancer mgr module does nothing (a warning is issued that says 'Too many objects are misplaced; try again later').
3. PGs are in a remapped state, where their acting and up sets are not equal. Backfilling is ongoing.
4. The progress bar in "ceph -s" shows that the cluster will take many hours or days to get out of this state. (backfilling to finish... i.e. all PGs active+clean).
5. OPTIMIZATION: The user runs the "upmap-remapped" tool (./upmap-remapped.py | sh -x), which creates upmap entries to align the up set with the acting set on remapped pgs.
6. Now, the cluster is back to HEALTH_OK, and it’s no longer necessary to move data.
7. The mgr balancer now works as usual to balance OSDs by utilization (pg / crush weight). The balancer follows its configuration, include start/end day/hour. target_max_misplaced, etc.

Proposal

Since the "upmap-remapped/pgremapper" tools are separate from Ceph, this requires extra complexity on the user's part. It is also patching behavior in the balancer mgr module that should be addressed:

1. If the % of misplaced objects exceeds “target_max_misplaced_ratio”, the balancer should issue mappings on remapped pgs to align the up sets with the acting sets.
2. The balancer module should address remapped pgs to stop rebalancing even if outside the balancer time window (begin_time/end_time configurable)
3. The balancer module should be aware of the number of osdmaps recorded in the cluster; if number of osdmaps exceeds ~10,000 then the balancer should stop adding upmap mappings to prevent the mon database from growing too large.
4. The balancer module should not create an upmap if it will lead to the pg going into "backfill_wait" state.

References:

1. upmap-remapped: https://github.com/cernceph/ceph-scripts/blob/master/tools/upmap/upmap-remapped.py
2. pgremapper: https://github.com/digitalocean/pgremapper


Subtasks 2 (1 open — 1 closed)

Feature #78996: Include upmap-remapped.py script in upstream codeResolvedLaura Flores

Actions
Feature #78997: Add upstream teuthology coverage and documentation for upmap-remapped.py scriptIn ProgressLaura Flores

Actions

Related issues 1 (0 open — 1 closed)

Related to mgr - Feature #66755: balancer: balance up set even if PGs degradedBackportingDan van der Ster

Actions

LF Updated by Laura Flores over 2 years ago Actions #1

  • Category set to balancer module

LF Updated by Laura Flores about 2 years ago Actions #2

  • Related to Feature #66755: balancer: balance up set even if PGs degraded added

LF Updated by Laura Flores about 2 years ago Actions #3

  • Subject changed from balancer: incorprate "upmap-remapped / pgremapper" logic with the balancer mgr module to balancer: incorporate "upmap-remapped / pgremapper" logic with the balancer mgr module

DV Updated by Dan van der Ster about 2 years ago Actions #4

Feedback from user/dev Sept 25:
  • #66755 is also important - need the balancer to help with degraded PGs
  • peering is disruptive, increasing latency. when we add a host we suffer a number of peering events: first when the osds are created with a weight, then again every time "upmap-remapped/pgremapper" maps data away from those new PGs. Better would be to do "osd create + upmap" in one single transaction.

NO Updated by Neha Ojha over 1 year ago Actions #5

  • Assignee set to Laura Flores

GO Updated by Gregory Orange over 1 year ago Actions #6

This all looks very good. We use upmap-remapped as standard procedure any time we want to control misplaced objects.

This might be an opportunity to address an issue we have with large dense clusters: Backfilling from even 0.3% (we often set target_max_misplaced_ratio to that) takes more than a day. On one cluster with months of balancing ahead of it, we turn the balancer on for a day per week, and off for the other six - an inversion of the typical 6-on-1-off. This is inefficient because the long tail is much slower backfilling than the first day or so.

Typically when this occurs one-off (such as adding some drives) we use upmap-remapped, stop when it gets very close to 0% and let the backfilling finish off. For this big cluster, we're not bothering because it's even less efficient to do this every week, and it will eventually sort itself out.

Could this new arrangement have a feature where the upmap-remapping target is different when the balancer is off? e.g.

balancer_enabled_target_max_misplaced_ratio 0.003
balancer_disabled_target_max_misplaced_ratio 0

Perhaps 0 is too low, but that could be a usage experience - set it to 0.0001 or so.

LF Updated by Laura Flores about 1 year ago Actions #7

  • Status changed from New to In Progress

LF Updated by Laura Flores about 1 year ago Actions #8

  • Tags set to user-dev

LF Updated by Laura Flores about 1 year ago Actions #9

  • Priority changed from Normal to High

LF Updated by Laura Flores 4 months ago Actions #10

  • Subtask #78996 added

LF Updated by Laura Flores 4 months ago Actions #11

  • Subtask #78997 added
Actions

Also available in: PDF Atom