Repository navigation
mgr, osd, mon: remove pg_upmap_primary mappings for PG merge targets - #69272
Conversation
8ca1e20 to
dcbb4d8
Compare
| "clear all pg primary entries (developers only)", | ||
| COMMAND("osd rm-pg-upmap-primary-all " | ||
| "name=pool,type=CephPoolname,req=false", | ||
| "clear all pg primary entries, or all entries for pool <pool> (developers only)", |
There was a problem hiding this comment.
Will fix once all reviews are complete
There was a problem hiding this comment.
Clarified the language here.
dcbb4d8 to
ebe3bbd
Compare
|
Fixed some minor issues with the script. |
ebe3bbd to
c48f918
Compare
rzarzynski
left a comment
There was a problem hiding this comment.
Overall LGTM! Architecturally it makes sense.
Just a question about potentially missed Fixes tag in one of the commits.
| ss << "unrecognized pool name '" << pool_name << "'"; | ||
| goto reply_no_propose; | ||
| } | ||
| osdmap.rm_all_upmap_prims(cct, &pending_inc, pool_id); |
| const string cmd = | ||
| "{" | ||
| "\"prefix\": \"osd rm-pg-upmap-primary-all\", " | ||
| "\"pool\": \"" + pool_name + "\"" + |
There was a problem hiding this comment.
Oh, now I see the justification for the making the cmd more flexible. The distinction between simple, low-level logic & more complex buildup outside makes sense to me.
| @@ -3302,6 +3302,7 @@ void DaemonServer::adjust_pgs() | |||
| std::map<string,unsigned> pg_num_to_set; | |||
There was a problem hiding this comment.
Shouldn't the description of this commit also have Fixes: https://tracker.ceph.com/issues/76731?
Now, the command `ceph osd rm-pg-upmap-primary-all` can optionally be run for a specific pool. The syntax is: `ceph osd rm-pg-upmap-primary-all <pool name>` This command can be used in a developer or advanced user setting, but it is also helpful in the DaemonServer code when we remove mappings on pools where pg_num was adjusted. I also clarified the descriptions in the pg-upmap-primary CLI commands. Fixes: https://tracker.ceph.com/issues/76731 Signed-off-by: Laura Flores <[email protected]>
`OSDMap::check_pg_upmaps` already takes care of removing pg_upmap_primary mappings for: 1. PGs that were “merge sources” (PGs that merged into another PG and thus no longer exist in the pool) 2. PGs that are “pending merge” (these PGs will end up becoming merge sources) But there is a third scenario that was missing for pg_upmap_primary: “merge targets”. The DaemonServer identifies PGs as “merge targets”, or the PGs that a “merge source” will merge into. If there is a pg_upmap, pg_upmap_items, or pg_upmap_primary mapping associated with a “merge target”, the DaemonServer issues this message: ``` 2026-05-14T21:16:56.700+0000 7f745e33d640 10 mgr.server operator() pool 5 pg_num_target 32 pg_num 33 - merge target 5.0 acting does not match (source [3,2,1] != target [3,1,2]) ``` Until the acting set of the “merge target” matches the “merge source”, the merging process will stall. One way the PG merging process is triggered is by removing the “bulk” flag from a pool. Removing upmap mappings for “merge target” PGs is not handled in the OSDMap code, but rather, the DaemonServer code. This patch adds in that missing logic. Fixes: https://tracker.ceph.com/issues/76731 Signed-off-by: Laura Flores <[email protected]>
Add test_read_balancer.sh to the rados teuthology workunits. The script is used to test any kind of balancer operations, whether it be via the mgr module or the CLI upmap commands. TEST_read_balancer_bulk_flag tests the balancer's interaction with the autoscaler --bulk flag and ensures that pg_upmap_primary mappings are properly cleared when a pool grows and reduces its pg_num. TEST_read_balancer_cli verifies the new CLI option to remove pg_upmap_primary mappings for a single pool: `ceph osd rm-pg-upmpa-primary-all <pool>`. Also, add a teuthology suite yaml to singleton-nomsgr. The `test_read_balancer.sh` script does not tolerate msgr error injections, so this is the best location for it as opposed to the singleton tests. Fixes: https://tracker.ceph.com/issues/76731 Signed-off-by: Laura Flores <[email protected]>
There is now the option to remove all pg_upmap_primary mappings on a single pool. Fixes: https://tracker.ceph.com/issues/76731 Signed-off-by: Laura Flores <[email protected]>
c48f918 to
6f99c8d
Compare
|
Changes were to address reviewer's nits. Marking with "needs-qa" now. |
|
This PR has been added to wip-yuri3-testing-20260808.022747-main. |
777e0af to
954fede
Compare
|
Taking "needs-qa" off of this as the latest commit is reviewed. |
…rations This test intentially made a test pool scale up and down (via the bulk flag) so we could verify that the read balancer's `pg_upmap_primary` entires get properly removed as PGs merge. Unintentionally, the test caused slow heartbeats because of a large amount of PG splitting that was happening as the pool scaled up. A large amount of PG splitting was causing the op threadpool to be consumed for up to 7 minutes, which exceeded the default osd_op_thread_timeout of 15 seconds and led to slow heartbeats. Adjusting `mgr_max_pg_num_change` from 128 to 32 means that there will be less PG splitting per osdmap epoch, and therefore less consumption on the op threadpool. Now, it takes only ~7 seconds for PG splitting per epoch. I also adjusted the `osd_op_thread_timeout` to 60s since, although much improved, the latest results still showed 2/30 tests failing from slow heartbeats. See full analysis of this issue here: https://gist.github.com/ljflores/72e66c405aaf2d3e004eddcbc77545bf Fixes: https://tracker.ceph.com/issues/76731 Signed-off-by: Laura Flores <[email protected]>
954fede to
543e9e6
Compare
OSDMap::check_pg_upmapsalready takes care of removing pg_upmap_primarymappings for:
no longer exist in the pool)
But there is a third scenario that was missing for pg_upmap_primary: “merge targets”.
The DaemonServer identifies PGs as “merge targets”, or the PGs that a “merge source”
will merge into. If there is a pg_upmap, pg_upmap_items, or pg_upmap_primary mapping
associated with a “merge target”, the DaemonServer issues this message:
Until the acting set of the “merge target” matches the “merge source”, the merging process
will stall. One way the PG merging process is triggered is by removing the “bulk” flag from a pool.
Removing upmap mappings for “merge target” PGs is not handled in the OSDMap code, but rather, the
DaemonServer code. This patch adds in that missing logic.
This patch also improves the
ceph osd rm-pg-upmap-primary-allcommand so all upmap_primary mappings can be removed on a per-pool basis.The syntax is:
This command can be used in a developer or advanced user setting,
but was mainly developed to be used in the DaemonServer code when we remove
mappings on pools where pg_num was adjusted.
Fixes: https://tracker.ceph.com/issues/76731
Signed-off-by: Laura Flores [email protected]
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.