From 95da0cdf96da96ba14cfbc5ee9489aabf9e10fbf Mon Sep 17 00:00:00 2001 From: Bill Scales Date: Wed, 21 May 2025 13:23:33 +0100 Subject: [PATCH] mon: prime_pg_temp needs to call pgtemp_primaryfirst when encoding pg_temp 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 --- src/mon/OSDMonitor.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 52c0e05c3a85..b23397f0bfc6 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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 pg_temp = pool ? next.pgtemp_primaryfirst(*pool, acting) : + acting; pending_inc.new_pg_temp.emplace( pgid, - mempool::osdmap::vector(acting.begin(), acting.end())); + mempool::osdmap::vector(pg_temp.begin(), pg_temp.end())); } } -- 2.47.3