]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
osd/PeeringState: handle race condition of DeferBackfill event for Backfilling state
authorNaveen Naidu <naveennaidu479@gmail.com>
Thu, 29 May 2025 08:58:32 +0000 (14:28 +0530)
committerNaveen Naidu <naveennaidu479@gmail.com>
Thu, 19 Jun 2025 11:19:18 +0000 (16:49 +0530)
commit8c19227c817420f6a736a40bb101349e36e126e2
treeedf52ff04def47984db163cd6a896449aaf80640
parentda27661273991bea1c61fa5cbfb00d8673b9df61
osd/PeeringState: handle race condition of DeferBackfill event for Backfilling state

Currently when PG in `Backfilling` state receives a `DeferBackfill`
event, there are cases when that event could race with
`MOSDPGBackfill::OP_BACKFILL_FINISH` becasue the PG has already
finished backfilling. In such case, the following
happens:
  1. PG state set to `PG_STATE_BACKFILL_WAIT`
  2. Suspend backfilling
  3. Discard the event

Notice that we do not reschedule backfill in the above steps, this can
lead to a situation where the PG gets stuck in a `backfill_wait` state
forever. This bug got introduced due to the following commit:

`865839f`: osd/PeeringState: check racing with OP_BACKFILL_FINISH when defering
backfill
Link: https://github.com/ceph/ceph/pull/60185
This commit, fixes that by making sure that in race conditions such as
above - we only discard the event.

Fixes: https://tracker.ceph.com/issues/71010
Signed-off-by: Naveen Naidu <naveen.naidu@ibm.com>
(cherry picked from commit b2bd15b4485f367c3f599a3d233d6e506b3285d1)
src/osd/PeeringState.cc