If the primary changes, cancel deletion so that the new primary has the
benefit of considering whether they need anything we have. Before we were
only canceling if our role changed, but that makes little sense.
Signed-off-by: Sage Weil <sage@newdream.net>
if (osdmap->is_down(oldacting[i]))
pg->on_osd_failure(oldacting[i]);
pg->on_change();
+
+ if (pg->deleting) {
+ dout(10) << *pg << " canceling deletion!" << dendl;
+ pg->deleting = false;
+ remove_wq.dequeue(pg);
+ }
if (role != oldrole) {
- // old stray?
- if (oldrole < 0 && pg->deleting) {
- dout(10) << *pg << " canceling deletion!" << dendl;
- pg->deleting = false;
- }
-
// old primary?
if (oldrole == 0) {
pg->state_clear(PG_STATE_CLEAN);