]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.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)
committerAlex Ainscow <aainscow@uk.ibm.com>
Wed, 25 Jun 2025 22:36:40 +0000 (23:36 +0100)
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>
src/mon/OSDMonitor.cc

index 52c0e05c3a85fd22c4846af4b48ada179225b716..b23397f0bfc6e37d4cc60e5fe2f4c86c1b748c7a 100644 (file)
@@ -1524,9 +1524,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()));
   }
 }