Bug #82062
closedOSDMap read balance scoring copies the whole map for every replicated pool
0%
Description
OSDMap::calc_read_balance_score makes a deepish_copy_from of the whole OSDMap and scores the copy, and get_pgs_by_osd, which the score calls for every pool, makes another copy to map the pool's PGs. Nothing changes either copy: every call made on them is const, and deepish_copy_from doesn't copy the CRUSH map anyway.
OSDMap::dump scores every replicated pool, so each dump copies the map twice per replicated pool, including every pg_upmap_items entry. The mgr dumps osd_map under the GIL whenever a Python module asks for it, and the mons do the same for osd dump and osd pool ls detail.
On the map of a Reef cluster with 1,018 OSDs, 173 pools of which 134 are replicated, and 10,108 pg_upmap_items entries, osdmaptool --dump json built from main takes 2.52 s, and 2.05 s without the two copies, with identical output. Most of the rest is mapping every PG of every replicated pool for the scores (tracker 82063 covers leaving them out of the mgr's osd_map getter).
The fix is to use the map itself in both places.
AD Updated by Anthony D'Atri about 1 month ago
- Status changed from New to Fix Under Review
- Pull request ID set to 73044
AD Updated by Anthony D'Atri about 1 month ago
- Description updated (diff)
LF Updated by Laura Flores 21 days ago
PR sent to a QA batch.
LF Updated by Laura Flores 14 days ago
PR still in QA.
UB Updated by Upkeep Bot 8 days ago
- Copied to Backport #83552: umbrella: OSDMap read balance scoring copies the whole map for every replicated pool added
UB Updated by Upkeep Bot 8 days ago
- Copied to Backport #83553: tentacle: OSDMap read balance scoring copies the whole map for every replicated pool added
UB Updated by Upkeep Bot 8 days ago
- Status changed from Fix Under Review to Backporting
- Merge Commit set to 4f91e58fcb3af2135dbdeab54bcb86a72b042b3f
- Fixed In set to v22.0.0-1491-g4f91e58fcb
- Upkeep Timestamp set to 2026-11-25T14:32:00+00:00