From c6a81b892216be9ace541b33e9b6c709148fecc0 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 (cherry picked from commit 95da0cdf96da96ba14cfbc5ee9489aabf9e10fbf) --- 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 c3780a06ba822..1a6349ac13207 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -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 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.39.5