Skip to content

Commit 87ddaa0

Browse files
authored
Merge pull request ceph#64043 from Naveenaidu/wip-71718-tentacle
tentacle: osd/PeeringState: handle race condition of DeferBackfill event for Backfilling state
2 parents e45b3d3 + 8c19227 commit 87ddaa0

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/osd/PeeringState.cc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5411,13 +5411,12 @@ boost::statechart::result
54115411
PeeringState::Backfilling::react(const DeferBackfill &c)
54125412
{
54135413
DECLARE_LOCALS;
5414-
5415-
psdout(10) << "defer backfill, retry delay " << c.delay << dendl;
5416-
ps->state_set(PG_STATE_BACKFILL_WAIT);
5417-
ps->state_clear(PG_STATE_BACKFILLING);
5418-
suspend_backfill();
5419-
54205414
if (ps->needs_backfill()) {
5415+
psdout(10) << "defer backfill, retry delay " << c.delay << dendl;
5416+
ps->state_set(PG_STATE_BACKFILL_WAIT);
5417+
ps->state_clear(PG_STATE_BACKFILLING);
5418+
suspend_backfill();
5419+
54215420
pl->schedule_event_after(
54225421
std::make_shared<PGPeeringEvent>(
54235422
ps->get_osdmap_epoch(),
@@ -5427,6 +5426,9 @@ PeeringState::Backfilling::react(const DeferBackfill &c)
54275426
return transit<NotBackfilling>();
54285427
} else {
54295428
// raced with MOSDPGBackfill::OP_BACKFILL_FINISH, ignore
5429+
psdout(10) << "discarding stale DeferBackfill event , pg does not need "
5430+
"backfill anymore"
5431+
<< dendl;
54305432
return discard_event();
54315433
}
54325434
}

0 commit comments

Comments
 (0)