Optimized EC pools were blocking clean_temps from clearing pg_temp
when up == acting but up_primary != acting_primary because optimized
pools sometimes use pg_temp to force a change of primary shard.
However this can block merges which require the two PGs being
merged to have the same primary. Relax clean_temps to permit
pg_temp to be cleared so long as the new primary is not a
non-primary shard.
Signed-off-by: Bill Scales <bill_scales@uk.ibm.com>
(cherry picked from commit
ce53276191e60375486f75d93508690f780bee21)
// force a change of primary shard - do not remove pg_temp
// if it is being used for this purpose
if (pool->allows_ecoptimizations()) {
- if (nextmap._pick_primary(pg.second) != primary) {
- // pg_temp still required
- keep = true;
+ // primary might not be in raw_up - so keep pg_temp unless
+ // proven that the primary is not a non-primary shard
+ keep = true;
+ for (unsigned int i = 0; i < raw_up.size(); ++i) {
+ if (raw_up[i] == primary) {
+ if (!pool->is_nonprimary_shard(shard_id_t(i))) {
+ // pg_temp not required
+ keep = false;
+ }
+ break;
+ }
}
}
if (!keep) {