It's critical that we keep the source and target PGs mapped to
the same place. Prevent new pg_upmaps on merge source or target
PGs.
Signed-off-by: Sage Weil <sage@redhat.com>
to_check.insert(p.first);
}
for (auto& pg : to_check) {
- if (!nextmap.pg_exists(pg)) {
- ldout(cct, 0) << __func__ << " pg " << pg << " is gone" << dendl;
+ const pg_pool_t *pi = nextmap.get_pg_pool(pg.pool());
+ if (!pi || pg.ps() >= pi->get_pg_num_pending()) {
+ ldout(cct, 0) << __func__ << " pg " << pg << " is gone or merge source"
+ << dendl;
+ to_cancel.insert(pg);
+ continue;
+ }
+ if (pi->is_pending_merge(pg, nullptr)) {
+ ldout(cct, 0) << __func__ << " pg " << pg << " is pending merge"
+ << dendl;
to_cancel.insert(pg);
continue;
}