]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Fix the problem by rechecking backfill status each time 26375/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 12 Feb 2019 04:07:42 +0000 (20:07 -0800)
committerDavid Zafman <dzafman@redhat.com>
Thu, 14 Feb 2019 17:53:14 +0000 (09:53 -0800)
a RemoteReservationRevoked message is received, so we can
restart the backfill process in a more safe and less-likely raced way.

Fixes: http://tracker.ceph.com/issues/38034
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/PG.cc

index 737142dd103b2a71c6f6fc1d72cd3e92a53fc752..0cafa2030c5dcbbab14e13d6a869c12da957b076 100644 (file)
@@ -7414,7 +7414,12 @@ PG::RecoveryState::Backfilling::react(const RemoteReservationRevoked &)
   PG *pg = context< RecoveryMachine >().pg;
   pg->state_set(PG_STATE_BACKFILL_WAIT);
   cancel_backfill();
-  return transit<WaitLocalBackfillReserved>();
+  if (pg->needs_backfill()) {
+    return transit<WaitLocalBackfillReserved>();
+  } else {
+    // raced with MOSDPGBackfill::OP_BACKFILL_FINISH, ignore
+    return discard_event();
+  }
 }
 
 void PG::RecoveryState::Backfilling::exit()