]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon: prime_pg_temp needs to call pgtemp_primaryfirst when encoding pg_temp
authorBill Scales <bill_scales@uk.ibm.com>
Wed, 21 May 2025 12:23:33 +0000 (13:23 +0100)
committerLaura Flores <lflores@ibm.com>
Wed, 9 Jul 2025 15:47:24 +0000 (15:47 +0000)
Optimized EC pools encode pgtemp in a different order putting the shards
which cannot become the primary (nonprimary shards) last.

prime_pg_temp is missing a call to pgtemp_primaryfirst to reorder the
acting set it is trying to set as pg_temp.

Signed-off-by: Bill Scales <bill_scales@uk.ibm.com>
(cherry picked from commit 95da0cdf96da96ba14cfbc5ee9489aabf9e10fbf)

src/mon/OSDMonitor.cc

index c3780a06ba8222918bf53159cca2d98338c2d7fb..1a6349ac132071a82e8f0e14740401f41129daf8 100644 (file)
@@ -1523,9 +1523,11 @@ void OSDMonitor::prime_pg_temp(
   {
     std::lock_guard l(prime_pg_temp_lock);
     // do not touch a mapping if a change is pending
+    std::vector<int> pg_temp = pool ? next.pgtemp_primaryfirst(*pool, acting) :
+                                      acting;
     pending_inc.new_pg_temp.emplace(
       pgid,
-      mempool::osdmap::vector<int>(acting.begin(), acting.end()));
+      mempool::osdmap::vector<int>(pg_temp.begin(), pg_temp.end()));
   }
 }