]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: EC optimizations bug in OSDMap::clean_temps
authorBill Scales <bill_scales@uk.ibm.com>
Thu, 22 May 2025 12:12:57 +0000 (13:12 +0100)
committerLaura Flores <lflores@ibm.com>
Wed, 9 Jul 2025 15:47:24 +0000 (15:47 +0000)
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 <bill_scales@uk.ibm.com>
(cherry picked from commit ef0025ab168e6dd604465921dbecb7fa3b0331bd)

src/osd/OSDMap.cc

index fd5982180cf7dc94c1403cd4c96ab7ed2bd0929a..e59b356cf98f10a21bd36dddb9e510623488e163 100644 (file)
@@ -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;