Project

General

Profile

Actions

Bug #76751

closed
JZ JZ

osd aborts on BackfillTooFull in RepNotRecovering

Bug #76751: osd aborts on BackfillTooFull in RepNotRecovering

Added by Jane Zhu 7 months ago. Updated about 3 hours ago.

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

0%

Source:
Backport:
tentacle,squid,umbrella
Regression:
No
Severity:
3 - minor
Reviewed:
ceph-qa-suite:
Component(RADOS):
OSD
Pull request ID:
Tags (freeform):
Fixed In:
v21.3.0-2969-gecfd49b5f9
Released In:
Upkeep Timestamp:
2026-12-02T22:43:52+00:00

Description

OSD crash with the following stacktrace

Program terminated with signal SIGABRT, Aborted.
...
* * BEGIN ACTIVE THREAD WALKBACK: /usr/bin/ceph-osd
#0  raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x0000557926a2fb1b in reraise_fatal (signum=6)
    at /usr/src/debug/ceph-19.2.1-24.bb.squid_release.el8.x86_64/src/global/signal_handler.cc:88
#2  handle_oneshot_fatal_signal (signum=6)
    at /usr/src/debug/ceph-19.2.1-24.bb.squid_release.el8.x86_64/src/global/signal_handler.cc:367
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x00007f8e439c2ee5 in __GI_abort () at abort.c:79
#6  0x000055792625ed30 in ceph::__ceph_abort (
    file=file@entry=0x5579274a7e18 "/root/rpmbuild/BUILD/ceph-19.2.1-24.bb.squid_release/src/osd/PeeringState.cc", line=line@entry=4628, 
    func=func@entry=0x5579274a8d48 "PeeringState::Crashed::Crashed(boost::statechart::state<PeeringState::Crashed, PeeringState::PeeringMachine>::my_context)", msg="we got a bad state machine event")
    at /usr/src/debug/ceph-19.2.1-24.bb.squid_release.el8.x86_64/src/common/assert.cc:198
#7  0x000055792671d3b2 in PeeringState::Crashed::Crashed (this=0x55799506bbd0, 
    ctx=...)
    at /usr/src/debug/ceph-19.2.1-24.bb.squid_release.el8.x86_64/src/osd/PeeringState.cc:4628
#8  0x00005579267532cd in boost::statechart::state<PeeringState::Crashed, PeeringState::PeeringMachine, boost::mpl::list<mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na>, (boost::statechart::history_mode)0>::shallow_construct (
    outermostContextBase=..., pContext=@0x7f8e26347020: 0x5579a5936688)
    at /usr/src/debug/ceph-19.2.1-24.bb.squid_release.el8.x86_64/x86_64-redhat-linux-gnu/boost/include/boost/statechart/state.hpp:38
...
#51 boost::statechart::simple_state<PeeringState::ReplicaActive, PeeringState::Started, PeeringState::RepNotRecovering, 
(boost::statechart::history_mode)0>::react_impl (this=<optimized out>, evt=..., eventType=<optimized out>)
    at /usr/src/debug/ceph-19.2.1-24.bb.squid_release.el8.x86_64/x86_64-redhat-linux-gnu/boost/include/boost/statechart/
simple_state.hpp:482
#52 0x0000557926488420 in boost::statechart::detail::send_function<boost::statechart::detail::state_base<std::allocator<boost::statechart::none>, boost::statechart::detail::rtti_policy>, boost::statechart::event_base, void const*>::operator() (this=<synthetic pointer>)
    at /usr/src/debug/ceph-19.2.1-24.bb.squid_release.el8.x86_64/x86_64-redhat-linux-gnu/boost/include/boost/statechart/state_machine.hpp:86
#53 boost::statechart::null_exception_translator::operator()<boost::statechart::detail::send_function<boost::statechart::detail::state_base<std::allocator<boost::statechart::none>, boost::statechart::detail::rtti_policy>, boost::statechart::event_base, void const*>, boost::statechart::state_machine<PeeringState::PeeringMachine, PeeringState::Initial, std::allocator<boost::statechart::none>, boost::statechart::null_exception_translator>::exception_event_handler> (action=..., 
    this=0x5579a59366f8)
    at /usr/src/debug/ceph-19.2.1-24.bb.squid_release.el8.x86_64/x86_64-redhat-linux-gnu/boost/include/boost/statechart/null_exception_translator.hpp:33
#54 boost::statechart::state_machine<PeeringState::PeeringMachine, PeeringState::Initial, std::allocator<boost::statechart::none>, boost::statechart::null_exception_translator>::send_event (evt=..., this=0x5579a5936688)
    at /usr/src/debug/ceph-19.2.1-24.bb.squid_release.el8.x86_64/x86_64-redhat-linux-gnu/boost/include/boost/statechart/state_machine.hpp:885
#55 boost::statechart::state_machine<PeeringState::PeeringMachine, PeeringState::Initial, std::allocator<boost::statechart::none>, boost::statechart::null_exception_translator>::process_event (this=this@entry=0x5579a5936688, evt=...)
    at /usr/src/debug/ceph-19.2.1-24.bb.squid_release.el8.x86_64/x86_64-redhat-linux-gnu/boost/include/boost/statechart/state_machine.hpp:275
#56 0x0000557926472fb4 in PeeringState::handle_event (rctx=0x7f8e263471a0, 
    evt=..., this=0x5579a5934f88)
    at /usr/src/debug/ceph-19.2.1-24.bb.squid_release.el8.x86_64/x86_64-redhat-linux-gnu/boost/include/boost/smart_ptr/intrusive_ptr.hpp:193
#57 PG::do_peering_event (this=this@entry=0x5579a5934000, 
    evt=std::shared_ptr<PGPeeringEvent> (use count 4, weak count 0) = {...}, 
    rctx=...)
    at /usr/src/debug/ceph-19.2.1-24.bb.squid_release.el8.x86_64/src/osd/PG.cc:2542
...

The state is PeeringState::RepNotRecovering. GDB reveals the event is BackfillTooFull. There is no BackfillTooFull handler in the state PeeringState::RepNotRecovering, hence its handling is being passed to ReplicaActive then to Started and ends up being transitioned to Crashed.


Related issues 3 (3 open — 0 closed)

Copied to RADOS - Backport #80302: squid: osd aborts on BackfillTooFull in RepNotRecoveringFix Under ReviewJane Zhu

Actions
Copied to RADOS - Backport #80303: tentacle: osd aborts on BackfillTooFull in RepNotRecoveringFix Under ReviewJane Zhu

Actions
Copied to RADOS - Backport #83951: umbrella: osd aborts on BackfillTooFull in RepNotRecoveringFix Under ReviewJane Zhu

Actions

JZ Updated by Jane Zhu 7 months ago Actions #2

It looks like I don't have permission to edit the Assignee and Status. Can someone from RADOS project update them for me? Thanks.

LF Updated by Laura Flores 6 months ago Actions #3

  • Backport set to tentacle,squid

RZ Updated by Radoslaw Zarzynski 6 months ago Actions #4

  • Status changed from New to Fix Under Review
  • Assignee set to Jane Zhu
  • Backport deleted (tentacle,squid)

RZ Updated by Radoslaw Zarzynski 6 months ago Actions #5

  • Backport set to tentacle,squid

LF Updated by Laura Flores 6 months ago Actions #6

Fix still under review.

RZ Updated by Radoslaw Zarzynski 6 months ago Actions #7

First round of review done.

RZ Updated by Radoslaw Zarzynski 6 months ago Actions #8

My hypothesis is:
1. BackfillTooFull is generated only in one single place: during MOSDPGScan::OP_SCAN_GET_DIGEST.
2. This request is handled by replicas when they are in the RepRecovering state. RepRecovering already has an appropriate event handler for BackfillTooFull.
3. However, there might be a race condition. MBackfillReserve::RELEASE generates the RemoteReservationCanceled event which could switch the state to RepNotRecovering while BackfillTooFull was about to be delivered).

JZ Updated by Jane Zhu 6 months ago Actions #9

Reproduce in vstart:

1. Change the source code to add some delay in the handling of MOSDPGScan::OP_SCAN_GET_DIGEST before queuing BackfillTooFull event. This is to make it easier to generate a RepNotRecovering state before BackfillTooFull is being handled.

@@ -4517,8 +4519,15 @@ void PrimaryLogPG::do_scan(
   case MOSDPGScan::OP_SCAN_GET_DIGEST:
     {
       auto dpp = get_dpp();
       if (osd->check_backfill_full(dpp)) {
        dout(1) << __func__ << ": Suspending backfill: Full." << dendl;
+       dout(0) << __func__ << ": Sleeping..." << dendl;
+       this->unlock();
+       sleep(10);
+       this->lock();
+       dout(0) << __func__ << ": Slept for 10 sec." << dendl;
        queue_peering_event(
          PGPeeringEventRef(
            std::make_shared<PGPeeringEvent>(
              get_osdmap_epoch(),
              get_osdmap_epoch(),
              PeeringState::BackfillTooFull())));

2. build and start a cluster using vstart.sh

$ MON=1 OSD=4 MGR=1 ../ceph-src/src/vstart.sh -n -d

3. Shrink PG log to force backfill

$ bin/ceph config set osd osd_min_pg_log_entries 1
$ bin/ceph config set osd osd_max_pg_log_entries 2

4. Create a replicated pool and write some data in it

$ bin/ceph osd pool create test 2 2
$ bin/ceph osd pool set test pg_autoscale_mode off
$ bin/rados -p test bench 10 write --no-cleanup

5. Pick a pg from the pool, and find out the primary osd and a replica osd

$ bin/ceph pg ls-by-pool test | head -3

6. Generate BackfillTooFull in RepNotRecovering state

$ bin/ceph osd set nobackfill
$ bin/ceph osd set norecover

down and kill the replica osd
$ bin/ceph osd down osd.${REPLICA}
$ kill <pid of osd.${REPLICA}>

wait for a bit

add more data to the pool
$ for i in $(seq 1 50); do
      bin/rados -p test put obj_$i /etc/hostname
  done

re-start the replica osd
$ bin/ceph-osd -i ${REPLICA} -c /build/ceph.conf &

make sure "backfill_wait" is seen in the output of the following commands
$ bin/ceph health detail
or
$ bin/ceph pg dump_stuck

inject backfillfull to the replica osd before backfill starts
$ bin/ceph tell osd.${REPLICA} injectfull backfillfull

get the pid of the primary osd
kill the primary osd to trigger a non-sequential switching to "RepNotRecovering" on the replica osd
please note: "set nobackfill" can not be used here to generate state "RepNotRecovering" since it's only
being processed after the MOSDPGScan::OP_SCAN_GET_DIGEST is done

$ bin/ceph osd unset norecover; bin/ceph osd unset nobackfill; sleep 1; kill <pid of osd.${PRIMARY}> 

7. observe the crash of the replica osd, and search for the stacktrace of the abort in PeeringState::Crashed in its log file

LF Updated by Laura Flores 6 months ago Actions #10

Thanks @janedevzhu - I will review the new changes. Thanks for including reproduction steps!

RZ Updated by Radoslaw Zarzynski 6 months ago ยท Edited Actions #11

Still under review, bump up.

LF Updated by Laura Flores 5 months ago Actions #12

The author pushed new changes; review of them in progress.

LF Updated by Laura Flores 5 months ago Actions #13

Still under review; on my TODO list.

UB Updated by Upkeep Bot 3 months ago Actions #14

  • Status changed from Fix Under Review to Pending Backport
  • Merge Commit set to ecfd49b5f9d24fff72400ac7dd3cb5ec99421044
  • Fixed In set to v21.3.0-2969-gecfd49b5f9
  • Upkeep Timestamp set to 2026-09-04T23:01:57+00:00

UB Updated by Upkeep Bot 3 months ago Actions #15

  • Copied to Backport #80302: squid: osd aborts on BackfillTooFull in RepNotRecovering added

UB Updated by Upkeep Bot 3 months ago Actions #16

  • Copied to Backport #80303: tentacle: osd aborts on BackfillTooFull in RepNotRecovering added

UB Updated by Upkeep Bot 3 months ago Actions #17

Redmine Upkeep failure

The redmine-upkeep.py script failed to update this issue. I have added the flag "upkeep-failed" to avoid looking at this issue again.

Please manually fix the issue and remove "upkeep-failed" flag to allow future upkeep operations.

Transformation

The script was in the None transformation.

Update Log

https://github.com/ceph/ceph/actions/runs/33933721617

Error

Redmine Update failed:

Traceback (most recent call last):
  File "/home/runner/work/ceph/ceph/ceph/src/script/redmine-upkeep.py", line 1392, in _process_issue_transformations
    response.raise_for_status()
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/requests/models.py", line 1026, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://tracker.ceph.com/issues/76751.json

Update Payload

{
    "issue": {
        "custom_fields": [
            {
                "id": 37,
                "value": "2026-09-05T00:44:05+00:00" 
            }
        ],
        "status_id": 40
    },
    "suppress_mail": "1" 
}

JZ Updated by Jane Zhu 16 days ago Actions #18

  • Backport changed from tentacle,squid to tentacle,squid,umbrella

JZ Updated by Jane Zhu 15 days ago Actions #19

Could someone with access please remove the upkeep-failed flag, or re-run Redmine Upkeep for this issue? I've added umbrella to Backport, but the bot skips flagged issues, so the umbrella backport tracker isn't being created.

UB Updated by Upkeep Bot about 3 hours ago Actions #20

  • Copied to Backport #83951: umbrella: osd aborts on BackfillTooFull in RepNotRecovering added

UB Updated by Upkeep Bot about 3 hours ago Actions #21

  • Status changed from Pending Backport to Backporting
  • Upkeep Timestamp changed from 2026-09-04T23:01:57+00:00 to 2026-12-02T22:43:52+00:00
Actions

Also available in: PDF Atom