Project

General

Profile

Actions

Bug #77096

open
BS

RemoteReservationRejectedTooFull in state WaitLocalBackfillReserved causes src/osd/PeeringState.cc: 5264: ceph_abort_msg("we got a bad state machine event")

Bug #77096: RemoteReservationRejectedTooFull in state WaitLocalBackfillReserved causes src/osd/PeeringState.cc: 5264: ceph_abort_msg("we got a bad state machine event")

Added by Bill Scales 6 months ago. Updated 7 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(RADOS):
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

https://pulpito.ceph.com/skanta-2026-06-02_04:58:02-rados-wip-bharath3-testing-2026-06-02-0837-distro-default-trial/253356

Description: rados/thrash-erasure-code-isa/{arch/x86_64 ceph clusters/{fixed-4} ec_optimizations/ec_optimizations_on mon_election/connectivity msgr-failures/osd-dispatch-delay objectstore/{bluestore/{alloc$/{stupid} base mem$/{normal-2} onode-segment$/{1M} write$/{v2/{compr$/{yes$/{zlib}} v2}}}} rados recovery-overrides/{more-active-recovery} supported-random-distro/{rocky_10} thrashers/careful_host thrashosds-health workloads/ec-rados-plugin=isa-k=8-m=6-technique=cauchy}

Related to https://tracker.ceph.com/issues/76751 in that both of these issues are caused by backfill reservation stimuli causing a crash in the peering state machine, but the stimuli and state involved are different.

Another race hazard in the Peering State Machine for backfill reservations

In this case there were 5 backfilling shards, 3 successfully completed the reserve, one revoked it which causes the attempt to backfill to stop. The code then starts another attempt at backfilling and starts making its local reservation, it is in this state when it receives the reply from the 5th shard about the previous attempt to backfill which was a rejection with toofull.

enter Started/Primary/Active/WaitRemoteBackfillReserved
do_peering_event: epoch_sent: 1903 epoch_requested: 1903 RemoteBackfillReserved
do_peering_event: epoch_sent: 1903 epoch_requested: 1903 RemoteBackfillReserved
do_peering_event: epoch_sent: 1903 epoch_requested: 1903 RemoteBackfillReserved
do_peering_event: epoch_sent: 1906 epoch_requested: 1906 RemoteReservationRevoked
exit Started/Primary/Active/WaitRemoteBackfillReserved 9.984450 40 0.002663
enter Started/Primary/Active/NotBackfilling
do_peering_event: epoch_sent: 1906 epoch_requested: 1906 RequestBackfill
exit Started/Primary/Active/NotBackfilling 30.179865 82 0.004852
enter Started/Primary/Active/WaitLocalBackfillReserved
do_peering_event: epoch_sent: 1923 epoch_requested: 1923 RemoteReservationRejectedTooFull
exit Started/Primary/Active/WaitLocalBackfillReserved 15.113135 50 0.002579
exit Started/Primary/Active 194.206745 0 0.000000
exit Started/Primary 202.245563 0 0.000000
exit Started 202.245610 0 0.000000
enter Crashed

A weakness with the backfill reservations is that the Primary releasing reservations can race with the backfilling shards rejecting the reservation. There is no ack to the release, and consequently the reservation rejections can be received several state transitions later - especially in teuthology tests like this one that were injecting messenger/dispatch delays.

Note that the fact there were so many backfilling shards increases the likelihood of this problem being seen.

Fix is to simply ignore this stimuli in this state. Probably need to review all of the backfill reservations part of the state machine for other similar race hazards as there are 4 messages (GRANT, REJECT_TOOFULL, REVOKE_TOOFULL and REVOKE) that can all be sent from the Backfilling shard to the Primary and can race with the Primary sending a RELEASE.

YS Updated by yulong shi 7 days ago Actions #1

I put up a fix: https://github.com/ceph/ceph/pull/74340

GRANT and REJECT_TOOFULL are now discarded in Active, like REVOKE_TOOFULL and REVOKE already are, so any Active state that isn't waiting for them ignores a stale one. While looking at this I noticed WaitLocalBackfillReserved used to discard GRANT (#44248), but its custom_reaction was dropped in 899f7e6d97e (pool migration), so main is also exposed to that older crash again.

The new TestPeeringState case reproduces the abort from this ticket without the fix.

Actions

Also available in: PDF Atom