Repository navigation
mgr: add an osd_map_pools getter for rbd_support - #72719
anthonyeleven wants to merge 1 commit into
Conversation
idryomov
left a comment
There was a problem hiding this comment.
Dumping osd_map holds the GIL while it converts every OSD and every pg_upmap_items entry to Python objects. It also computes a read balance score for each replicated pool, and each score copies the OSDMap and maps every PG of the pool.
Isn't the Python object representation of osd_map as a whole supposed to be cached by MgrMapCache which is enabled by default (mgr_map_cache_enabled config option)?
static const std::unordered_set<std::string> mgr_cache_keys = {
"osd_map", "pg_dump", "pg_stats", "mon_status", "mgr_map",
"osd_metadata", "mds_metadata", "config"
};
|
@idryomov Good question. MgrMapCache came in with 403340b, which is on main and umbrella but not tentacle or reef. The stalls in the description are from Reef 18.2.8, where the only cache is the old TTL cache and mgr_ttl_cache_expire_seconds defaults to 0, so every call pays for the full dump. That also holds on tentacle, one of the two backport targets. Where MgrMapCache is enabled, ActivePyModules::notify_all invalidates it on every osd_map notify, so it only helps between epochs. In a five-minute sample on the cluster in question the osdmap moved twice, so roughly every second or third rbd_support call still rebuilds the full dump under the GIL, read balance scores included. rbd_support needs only pool ids, names and applications, so the pools-only getter avoids that cost whether or not the cache is warm. |
|
@idryomov gentle ping: does the reply above answer your MgrMapCache question? Since MgrMapCache isn't in tentacle or reef and is invalidated on every osdmap change, the pools-only getter still saves the full dump there. |
|
@idryomov Another gentle ping on the MgrMapCache question above. #73045, now approved, leaves the read balance scores out of the |
idryomov
left a comment
There was a problem hiding this comment.
Since MgrMapCache isn't in tentacle or reef and is invalidated on every osdmap change, the pools-only getter still saves the full dump there.
Speaking about main and umbrella, is the "invalidated on every osdmap change" a problem? If the manager calling OSDMap::dump() once per epoch and caching the result shows up on any profile, something is seriously wrong with OSDMap::dump().
Reef is EOL, but this looks fine to be merged and backported all the way up to squid.
|
Thanks for taking the time on this one. The cache is a very new feature that hasn't had much shakeout yet. On Umbrella 21.2.0 it made the active mgr grow by about 1 GB an hour, and the advice on the list was to set |
idryomov
left a comment
There was a problem hiding this comment.
Please squash everything into a single commit. Otherwise LGTM!
ceph#73044 removes the OSDMap copies that calc_read_balance_score() and get_pgs_by_osd() make, so drop "copy the map" from the osd_map getter comment. This is the wording Ilya Dryomov suggested on ceph#72719. Fixes: https://tracker.ceph.com/issues/82063 Signed-off-by: Anthony D'Atri <[email protected]> Assisted-by: Claude Opus-5.5
119d3b1 to
6338400
Compare
|
This PR has been added to wip-bharath20-testing-20261109.055221-main. |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
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
6338400 to
68740fa
Compare
|
jenkins test make check arm64 |
1 similar comment
|
jenkins test make check arm64 |
|
jenkins test windows |
|
jenkins test make check arm64 |
Fixes: https://tracker.ceph.com/issues/81783
The mirror snapshot and trash purge schedule handlers in rbd_support each call
get_rbd_poolsonce a minute, even when no schedules exist.get_rbd_poolsfetchesosd_maponly to read pool ids, names and applications.Dumping
osd_mapholds the GIL while it converts every OSD and everypg_upmap_itemsentry to Python objects. It also computes a read balance score for each replicated pool, and each score copies the OSDMap and maps every PG of the pool. On a Reef cluster with 10,130pg_upmap_itemsentries, Python module commands stalled for about 6 seconds every 66 seconds.This gives
OSDMap::dump_pool()awith_read_balanceparameter, as #73045 does, and adds anosd_map_poolsgetter that returns the list of pools, dumped throughdump_pool()without the read balance scores.get_rbd_poolsandTaskHandler.resolve_pool_nameuse the getter. Other modules that only need pools, such as the prometheus module'sget_rbd_stats, could use it too.The new key is not added to the mgr API cache, since dumping only the pools is cheap.
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