]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Fix the problem by rechecking backfill status each time 28201/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 12 Feb 2019 04:07:42 +0000 (20:07 -0800)
committerDavid Zafman <dzafman@redhat.com>
Tue, 21 May 2019 17:48:27 +0000 (10:48 -0700)
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>
(cherry picked from commit 9111ac7177c48fb0e4a0017e5734477a92198d2a)

src/osd/PG.cc

index b06852859efc29633916aa7e765872f48c5ca1ff..dcc545f82a212725fae2e4acf1c6670d57ef07d1 100644 (file)
@@ -7152,7 +7152,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()