-
Notifications
You must be signed in to change notification settings - Fork 8
tools: add pg backfill_toofull fix #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JoshuaGabriel
wants to merge
1
commit into
clyso:main
Choose a base branch
from
JoshuaGabriel:toolkit/pg_toofull
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
|
|
||
| # Upmap fix for PGs with backfill toofull warnings | ||
|
|
||
| ``` | ||
| health: HEALTH_WARN | ||
| 10 nearfull osd(s) | ||
| 10 backfilltoofull osd(s) | ||
| Low space hindering backfill (add storage if this doesn't resolve itself): 1 pg backfill_toofull | ||
| ``` | ||
|
|
||
| Problem: | ||
| Usually when a node goes down or when draining capacity, there are some OSDs that become nearfull and eventually can lead to PGs being backfill_toofull warning pops up. | ||
|
|
||
| Why does this happen? Currently the balancer doesn't do a good job of evenly spreading out data based on % utlization of an OSD and it could be the case that there is not enough capacity to backfill data. | ||
|
|
||
| ``` | ||
| $ ceph osd df tree | ||
| ID CLASS WEIGHT REWEIGHT SIZE RAW USE DATA OMAP META AVAIL %USE VAR PGS STATUS TYPE NAME | ||
| -2 31073.90820 - 30 PiB 24 PiB 24 PiB 2.4 TiB 74 TiB 6.1 PiB 79.77 1.00 - root default | ||
| -10 4310.90576 - 4.2 PiB 3.4 PiB 3.4 PiB 435 GiB 9.7 TiB 863 TiB 79.99 1.00 - rack rack1 | ||
| -51 176.40302 - 176 TiB 144 TiB 144 TiB 41 GiB 422 GiB 32 TiB 81.66 1.02 - host ceph-host1 | ||
| 642 hdd 7.27736 1.00000 7.3 TiB 6.6 TiB 6.6 TiB 4.7 MiB 19 GiB 659 GiB 91.16 1.14 16 up osd.642 <--- most full | ||
| 643 hdd 7.27736 1.00000 7.3 TiB 5.7 TiB 5.6 TiB 5.1 MiB 16 GiB 1.6 TiB 77.70 0.97 15 up osd.643 <--- least full | ||
| 644 hdd 7.27736 1.00000 7.3 TiB 6.1 TiB 6.1 TiB 916 KiB 18 GiB 1.1 TiB 84.40 1.06 15 up osd.644 | ||
| 645 hdd 7.27736 1.00000 7.3 TiB 5.9 TiB 5.9 TiB 3.3 MiB 17 GiB 1.4 TiB 81.00 1.02 14 up osd.645 | ||
| 647 hdd 7.27736 1.00000 7.3 TiB 5.4 TiB 5.4 TiB 274 KiB 16 GiB 1.9 TiB 74.28 0.93 13 up osd.647 | ||
| 648 hdd 7.27736 1.00000 7.3 TiB 5.9 TiB 5.9 TiB 208 KiB 17 GiB 1.4 TiB 81.03 1.02 15 up osd.648 | ||
| 649 hdd 7.27736 1.00000 7.3 TiB 6.1 TiB 6.1 TiB 181 KiB 18 GiB 1.1 TiB 84.35 1.06 16 up osd.649 | ||
| 650 hdd 7.27736 1.00000 7.3 TiB 6.1 TiB 6.1 TiB 5.4 MiB 18 GiB 1.1 TiB 84.36 1.06 16 up osd.650 | ||
| 653 hdd 7.27736 1.00000 7.3 TiB 6.1 TiB 6.1 TiB 3.4 MiB 18 GiB 1.1 TiB 84.46 1.06 16 up osd.653 | ||
| .... | ||
| .... | ||
| ``` | ||
|
|
||
| An example of a cluster here with OSDs in this cluster that have 91% use, while some other OSD has 74%. It is also true in this cluster that there are very big PG sizes because of the small PG numbers per OSD. | ||
|
|
||
| In the event a host goes down, there will be degraded objects. The built-in ceph balancer does not run when there are degraded objects, so CRUSH will decide on which OSD the backfilling PGs will go into. But what if that OSD is backfilltoofull? Well it could be the case that the cluster is now 'stuck', it can't resolve the degraded objects because it can't backfill because an OSD is toofull. | ||
|
|
||
| The solution to this is we can upmap this PG to another OSD. Instead of CRUSH picking a random OSD that could be already 91% full, let's tell it to use the OSD with 77% | ||
|
|
||
| The steps would be to | ||
| 1. Find the PG that is backfill_toofull. | ||
| 2. Cross reference with `ceph pg dump` to see where that PG is originally from and where it wants to go. | ||
| 3. Find another OSD that we want to upmap it to, and adhears to the failure domain of the cluster. | ||
| 4. Construct the upmap command | ||
|
|
||
| ``` | ||
| ceph osd pg-upmap-items 70.2e3 642 643 | ||
| ``` | ||
|
|
||
| This comes very tedious very fast if we have a lot of PGs that are backfill_toofull | ||
|
|
||
| There is a script called clyso-upmap-toofull.py that does this for you | ||
|
|
||
| ``` | ||
| ./clyso-upmap-pg-toofull | ||
| # [DRY-RUN] Generated 9 command(s) (use --write to execute or pipe to sh): | ||
| ceph osd pg-upmap-items 70.122e 2172 41 801 835 31 29 | ||
| ceph osd pg-upmap-items 70.103c 452 29 | ||
| ceph osd pg-upmap-items 70.fa0 1327 1249 1718 2065 454 29 | ||
| ceph osd pg-upmap-items 70.eaa 307 686 2118 1327 464 29 | ||
| ceph osd pg-upmap-items 70.4a3 913 1397 456 29 | ||
| ceph osd pg-upmap-items 70.750 2287 2026 190 922 2026 2002 | ||
| ceph osd pg-upmap-items 70.980 1637 2478 244 389 464 29 | ||
| ceph osd pg-upmap-items 70.1937 2524 2175 2489 1089 454 29 | ||
| ``` | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually when a node goes down or when draining capacityseems broken. Should it beUsually when a node goes down or when draining with limited capacity?