Skip to content

Commit 13b9cdf

Browse files
committed
osd/PeeringState: set PG_STATE_BACKFILLING before calling
on_backfill_reserved Signed-off-by: Xuehan Xu <[email protected]>
1 parent 48f2943 commit 13b9cdf

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/crimson/osd/pg_recovery.cc

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -669,13 +669,7 @@ void PGRecovery::on_activate_complete()
669669
void PGRecovery::on_backfill_reserved()
670670
{
671671
logger().debug("{}", __func__);
672-
// yes, it's **not** backfilling yet. The PG_STATE_BACKFILLING
673-
// will be set after on_backfill_reserved() returns.
674-
// Backfill needs to take this into consideration when scheduling
675-
// events -- they must be mutually exclusive with PeeringEvent
676-
// instances. Otherwise the execution might begin without having
677-
// the state updated.
678-
ceph_assert(!pg->get_peering_state().is_backfilling());
672+
ceph_assert(pg->get_peering_state().is_backfilling());
679673
// let's be lazy with creating the backfill stuff
680674
using BackfillState = crimson::osd::BackfillState;
681675
if (!backfill_state) {

src/osd/PeeringState.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5081,10 +5081,10 @@ PeeringState::Backfilling::Backfilling(my_context ctx)
50815081

50825082
DECLARE_LOCALS;
50835083
ps->backfill_reserved = true;
5084-
pl->on_backfill_reserved();
50855084
ps->state_clear(PG_STATE_BACKFILL_TOOFULL);
50865085
ps->state_clear(PG_STATE_BACKFILL_WAIT);
50875086
ps->state_set(PG_STATE_BACKFILLING);
5087+
pl->on_backfill_reserved();
50885088
pl->publish_stats_to_osd();
50895089
}
50905090

0 commit comments

Comments
 (0)