Repository navigation
mgr: leave read balance scores out of the osd_map getter - #73045
Conversation
|
Build and test results, on a CentOS Stream 9 container with GCC 11.5,
I haven't run a mgr with this change, so the |
NitzanMordhai
left a comment
There was a problem hiding this comment.
LGTM, just 1 thing about the unit-tests, can you please add a new test in TestOSDMap.cc that will check the new param is working correctly? Maybe dump JSONFormatter both ways and checks that read_balance shows up only for replicated pools when the flag is true, and never when it's false. That protects the balancer's read mode if someone later flips the default.
|
also mention here my PR #72754 those 2 solution complete each other |
|
@NitzanMordhai thanks. Both done:
|
|
This PR has been added to wip-bharath15-testing-20261102.042818-main. |
1f3b8ca to
c3936c4
Compare
|
Rebuilt on main at de83537 with just these two commits, on a CentOS Stream 9 container with GCC 11.5,
|
|
@SrinivasaBharath this changed after it went into wip-bharath15-testing-20261102.042818-main: that batch has 1f3b8ca, and the PR is now at c3936c4. |
c3936c4 to
7081c3f
Compare
|
Back to the previous version: d5cbc07 is 27fdd58 with @SrinivasaBharath this matches what wip-bharath15-testing-20261102.042818-main has, apart from that default argument, which changes no behavior. |
Add OSDMap::dump_pools(), which dumps every pool through dump_pool(), optionally without the read balance scores, and have OSDMap::dump() use it. dump_pool() takes the same with_read_balance parameter as in ceph#73045. The osd_map_pools getter now calls dump_pools() instead of open-coding the pools, and returns the list of pools itself rather than a dict with a pools key. Fixes: https://tracker.ceph.com/issues/81783 Signed-off-by: Anthony D'Atri <[email protected]> Assisted-by: Claude Opus-5.5
7081c3f to
e84c618
Compare
|
Please squash everything into a single commit. |
OSDMap::dump computes a read balance score for every replicated pool, and each score maps every PG of the pool. The mgr's osd_map getter dumps the map under the GIL whenever a Python module asks for it, so every module stalls while the scores are computed. No module needs them there. The balancer gets them from get_osdmap().dump(), which still includes them, and the mons still include them in osd dump and osd pool ls detail. Add a with_read_balance argument to OSDMap::dump, true by default, and to dump_pool, and have the getter pass false. The dashboard's /api/pool stops returning the read_balance field it passed through, which neither its UI nor its OpenAPI spec uses. TestOSDMap dumps the map with the default, with with_read_balance true and with it false. The replicated pool must have a read_balance section in the first two dumps and not in the third, and the erasure-coded pool never has one. The balancer's read modes rely on the default dump including the scores. Fixes: https://tracker.ceph.com/issues/82063 Signed-off-by: Anthony D'Atri <[email protected]> Assisted-by: Claude Opus-5.5
a352cc6 to
7208ceb
Compare
The mirror snapshot and trash purge schedule handlers in rbd_support each call get_rbd_pools once a minute, even when no schedules exist. get_rbd_pools fetches osd_map only to read pool ids, names and applications. Dumping osd_map holds the GIL while it converts every OSD and every pg_upmap_items entry to Python objects. On a cluster with 10,000 pg_upmap_items entries this stalled other mgr modules for about 6 seconds each minute, before ceph#73045 took the read balance scores out of the osd_map getter. Add an osd_map_pools getter that returns the list of pools in osd_map, each dumped by OSDMap::dump_pool() without the read balance scores, and use it in get_rbd_pools and resolve_pool_name. Fixes: https://tracker.ceph.com/issues/81783 Signed-off-by: Anthony D'Atri <[email protected]> Assisted-by: Claude Opus-5.5
Fixes: https://tracker.ceph.com/issues/82063
OSDMap::dumpcomputes a read balance score for every replicated pool, and each score maps every PG of the pool. The mgr'sosd_mapgetter dumps the map under the GIL whenever a Python module asks for it, so every module stalls while the scores are computed.On a Reef 18.2.8 cluster with 1,018 OSDs, 134 replicated pools and 10,108
pg_upmap_itemsentries,osdmaptool --dump jsonof the same map takes 2.55 s with Reef and 0.09 s with Quincy, which has no read balance score. The prometheus module readsosd_maptwice per collection there, and the mgr stops dispatching messages for about 7 s each time. rbd_support reads it twice a minute.No module needs the scores from
osd_map:get_osdmap().dump(), which still includes them.ceph osd dumpandceph osd pool ls detailare served by the mons and are unchanged./api/pool, includingread_balance. Neither its UI nor its OpenAPI spec uses it, so the field just stops appearing there.This adds a
with_read_balanceargument toOSDMap::dump, true by default, and todump_pool. Only theosd_mapgetter passes false, so every other dump keeps the scores, including the mons'osd dumpandreport,osdmaptool --dump, ceph-dencoder, ceph-objectstore-tool, and the mgr'sOSDMap.dump(), which the balancer's read modes read them from. #73044 makes the scores cheaper for the callers that still want them.#72754 complements this. It has pg_autoscaler and the balancer read the
osd_mapgetter instead of building their own dump withOSDMap.dump(), and this PR takes the scores out of that getter. With both, the balancer'supmapmode plans from the getter's dump, which doesn't need the scores. Thereadandupmap-readmodes still plan fromosdmap.dump(), which has them.The new
DumpWithReadBalancetest inTestOSDMap.ccdumps the map with the default, withwith_read_balancetrue and with it false. It checks that the replicated pool has aread_balancesection in the first two dumps and not in the third, and that the EC pool never has one.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.
Signed-off-by: Anthony D'Atri [email protected]
Assisted-by: Claude Opus-5.5