Skip to content

Commit 865839f

Browse files
committed
osd/PeeringState: check racing with OP_BACKFILL_FINISH when defering
backfill Signed-off-by: Xuehan Xu <[email protected]>
1 parent 13b9cdf commit 865839f

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/osd/PeeringState.cc

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5130,13 +5130,18 @@ PeeringState::Backfilling::react(const DeferBackfill &c)
51305130
ps->state_clear(PG_STATE_BACKFILLING);
51315131
suspend_backfill();
51325132

5133-
pl->schedule_event_after(
5134-
std::make_shared<PGPeeringEvent>(
5135-
ps->get_osdmap_epoch(),
5136-
ps->get_osdmap_epoch(),
5137-
RequestBackfill()),
5138-
c.delay);
5139-
return transit<NotBackfilling>();
5133+
if (ps->needs_backfill()) {
5134+
pl->schedule_event_after(
5135+
std::make_shared<PGPeeringEvent>(
5136+
ps->get_osdmap_epoch(),
5137+
ps->get_osdmap_epoch(),
5138+
RequestBackfill()),
5139+
c.delay);
5140+
return transit<NotBackfilling>();
5141+
} else {
5142+
// raced with MOSDPGBackfill::OP_BACKFILL_FINISH, ignore
5143+
return discard_event();
5144+
}
51405145
}
51415146

51425147
boost::statechart::result

0 commit comments

Comments
 (0)