From: Bill Scales Date: Thu, 22 May 2025 12:12:57 +0000 (+0100) Subject: osd: EC optimizations bug in OSDMap::clean_temps X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ef0025ab168e6dd604465921dbecb7fa3b0331bd;p=ceph.git osd: EC optimizations bug in OSDMap::clean_temps OSDMap clean_temps clears pg_temp for a PG when the up set matches the acting_set. For optimized EC pools the pg_temp is reordered to place primary shards first, this function was not calling pgtemp_undo_primaryfirst to revert the reordering. This meant that a 2+1 EC PG with up set [1,2,3] and a desired acting set [1,3,2] re-ordered the acting set to produce pg_temp as [1,2,3] and then deleted this because it equals the up set. Calling pgtemp_undo_primaryfirst makes this code work as intended. Signed-off-by: Bill Scales --- diff --git a/src/osd/OSDMap.cc b/src/osd/OSDMap.cc index fd5982180cf7..e59b356cf98f 100644 --- a/src/osd/OSDMap.cc +++ b/src/osd/OSDMap.cc @@ -2026,7 +2026,9 @@ void OSDMap::clean_temps(CephContext *cct, int primary; nextmap.pg_to_raw_up(pg.first, &raw_up, &primary); bool remove = false; - if (raw_up == pg.second) { + const pg_pool_t *pool = nextmap.get_pg_pool(pg.first.pool()); + auto acting_set = nextmap.pgtemp_undo_primaryfirst(*pool, pg.first, pg.second); + if (raw_up == acting_set) { ldout(cct, 10) << __func__ << " removing pg_temp " << pg.first << " " << pg.second << " that matches raw_up mapping" << dendl; remove = true;