Project

General

Profile

Actions

Bug #79951

closed
TH MK

Ceph MDS outage caused by a crash in the batch-op cleanup path

Bug #79951: Ceph MDS outage caused by a crash in the batch-op cleanup path

Added by Torsten Heinig 3 months ago. Updated 3 months ago.

Status:
Backporting
Priority:
Normal
Category:
Correctness/Safety
Target version:
Due date:
% Done:

0%

Source:
Community (user)
Backport:
umbrella,tentacle,squid
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
MDS
Labels (FS):
crash
Pull request ID:
Tags (freeform):
Fixed In:
v21.3.0-3027-g165146c041
Released In:
Upkeep Timestamp:
2026-09-08T12:28:29+00:00

Description

We hit another Ceph MDS outage caused by a crash in the batch-op cleanup path.

The issue begins with a large number of slow requests stuck in the MDS while waiting to acquire write locks. The queue eventually reaches a severe backlog, and the affected client is evicted. During eviction, the MDS crashes with an assertion in the batch-op map logic.

Relevant log snippets:

Aug 24 00:15:32 ceph-mds: log_channel(cluster) log [WRN] : 3 slow requests, 3 included below; oldest blocked for > 30 secs
Aug 24 00:15:32 ceph-mds: log_channel(cluster) log [WRN] : slow request 30s old: client_request(... lookup ...) currently failed to wrlock, waiting
Aug 24 00:15:32 ceph-mds: log_channel(cluster) log [WRN] : slow request 30s old: client_request(... rename ...) currently failed to wrlock, waiting
Aug 24 00:15:32 ceph-mds: log_channel(cluster) log [WRN] : slow request 30s old: client_request(... create ...) currently failed to wrlock, waiting

Peak backlog:

Aug 24 01:47:07 ceph-mds: log_channel(cluster) log [WRN] : 60 slow requests, 5 included below; oldest blocked for > 5500 secs
Aug 24 01:47:07 ceph-mds: log_channel(cluster) log [WRN] : slow request ... currently joining batch lookup
Aug 24 01:47:07 ceph-mds: log_channel(cluster) log [WRN] : slow request ... currently joining batch getattr

After client eviction is attempted:

Aug 24 01:47:09 ceph-mds: log_channel(cluster) log [INF] : Evicting client session ...
ceph-mds: .../bits/stl_tree.h: ...: std::_Rb_tree<...>::erase(...) Assertion '__position != end()' failed.
ceph-mds: * Caught signal (Segmentation fault) *
in thread ... thread_name:admin_socket

This is a crash due to an assertion failure in Ceph MDS code. The underlying issue is a map of batch operations:

std::map<int, std::unique_ptr<BatchOp>> batch_ops;

A pointer to this map is stored in MDRequestImpl::batch_op_map. The erase() call is invoked with an iterator that can be end(), which is invalid. There are multiple erase paths that do not check whether the item exists before moving or erasing it.

Example:

std::unique_ptr<BatchOp> MDRequestImpl::release_batch_op() {
int mask = client_request->head.args.getattr.mask;
auto it = batch_op_map->find(mask);
std::unique_ptr<BatchOp> bop = std::move(it->second);
batch_op_map->erase(it);
return bop;
}

This assumes the item exists, but there is no check for not-found conditions. This makes the code fragile under concurrent state changes and is consistent with the observed crash path.

We believe this is the same class of bug as a previously observed MDS crash and that the fix should guard against missing entries and invalid iterators before erase or access.

Affected versions appear to include Ceph 18.2.x and current master / upstream code.

There's already a PR open for that. Please check it
https://github.com/ceph/ceph/pull/71274


Related issues 3 (1 open — 2 closed)

Copied to CephFS - Backport #80372: umbrella: Ceph MDS outage caused by a crash in the batch-op cleanup pathFix Under ReviewJos Collin

Actions
Copied to CephFS - Backport #80373: squid: Ceph MDS outage caused by a crash in the batch-op cleanup pathResolvedJos Collin

Actions
Copied to CephFS - Backport #80374: tentacle: Ceph MDS outage caused by a crash in the batch-op cleanup pathResolvedJos Collin

Actions

XL Updated by Xiubo Li 3 months ago Actions #1

  • Status changed from New to Fix Under Review

PD Updated by Patrick Donnelly 3 months ago Actions #2

  • Project changed from Ceph to CephFS
  • Assignee set to Max Kellermann
  • Target version set to v22.0.0
  • Source set to Community (user)
  • Backport set to umbrella,tentacle,squid
  • Labels (FS) crash added

VS Updated by Venky Shankar 3 months ago Actions #3

  • Category set to Correctness/Safety
  • Component(FS) MDS added

UB Updated by Upkeep Bot 3 months ago Actions #4

  • Status changed from Fix Under Review to Pending Backport
  • Merge Commit set to 165146c0417c8ffeef7eeb6abb798a17b980dc7f
  • Fixed In set to v21.3.0-3027-g165146c041
  • Upkeep Timestamp set to 2026-09-08T05:40:38+00:00

UB Updated by Upkeep Bot 3 months ago Actions #5

  • Copied to Backport #80372: umbrella: Ceph MDS outage caused by a crash in the batch-op cleanup path added

UB Updated by Upkeep Bot 3 months ago Actions #6

  • Copied to Backport #80373: squid: Ceph MDS outage caused by a crash in the batch-op cleanup path added

UB Updated by Upkeep Bot 3 months ago Actions #7

  • Copied to Backport #80374: tentacle: Ceph MDS outage caused by a crash in the batch-op cleanup path added

UB Updated by Upkeep Bot 3 months ago Actions #8

  • Status changed from Pending Backport to Backporting
  • Upkeep Timestamp changed from 2026-09-08T05:40:38+00:00 to 2026-09-08T12:28:29+00:00
Actions

Also available in: PDF Atom