OSDMap clean_temps clears pg_temp for a PG when the up set
matches the acting_set. For optimized EC pools the pg_temp
is reordered to place primary shards first, this function
was not calling pgtemp_undo_primaryfirst to revert the
reordering.
This meant that a 2+1 EC PG with up set [1,2,3] and
a desired acting set [1,3,2] re-ordered the acting
set to produce pg_temp as [1,2,3] and then deleted this
because it equals the up set.
Calling pgtemp_undo_primaryfirst makes this code work
as intended.
Signed-off-by: Bill Scales <bill_scales@uk.ibm.com>
(cherry picked from commit
ef0025ab168e6dd604465921dbecb7fa3b0331bd)
int primary;
nextmap.pg_to_raw_up(pg.first, &raw_up, &primary);
bool remove = false;
- if (raw_up == pg.second) {
+ const pg_pool_t *pool = nextmap.get_pg_pool(pg.first.pool());
+ auto acting_set = nextmap.pgtemp_undo_primaryfirst(*pool, pg.first, pg.second);
+ if (raw_up == acting_set) {
ldout(cct, 10) << __func__ << " removing pg_temp " << pg.first << " "
<< pg.second << " that matches raw_up mapping" << dendl;
remove = true;