Project

General

Profile

Actions

Bug #77797

closed
XL XL

MDS: perf_counters.cc: 181: FAILED ceph_assert(idx > m_lower_bound)

Bug #77797: MDS: perf_counters.cc: 181: FAILED ceph_assert(idx > m_lower_bound)

Added by Xiubo Li 5 months ago. Updated 3 months ago.

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

0%

Source:
Community (dev)
Backport:
tentacle, squid, umbrella
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-1748-gbb2afd0a19
Released In:
Upkeep Timestamp:
2026-08-27T18:44:09+00:00

Description

8158    -11> 2026-06-30T09:13:58.611+0800 7fbf51fef6c0  4 mds.0.server handle_client_request client_request(client.7849:8643 lookup #0x10000000015/6 2026-06-30T09:13:58.611369+0800 caller_uid=1000, caller_gid=1000{10,985,1000,})
8159    -10> 2026-06-30T09:13:58.612+0800 7fbf51fef6c0  4 mds.0.server handle_client_request client_request(client.7849:8644 lookup #0x1000000004d/7280.tmp 2026-06-30T09:13:58.612369+0800 caller_uid=1000, caller_gid=1000{10,985,1000,})
8160     -9> 2026-06-30T09:13:58.651+0800 7fbf4dfe76c0  2 mds.0.cache Memory usage:  total 10516556, rss 10236864, heap 10716381184, baseline 255889408, 764 / 2914833 inodes have caps, 764 caps, 0.000262108 caps per inode
8161     -8> 2026-06-30T09:13:58.651+0800 7fbf4dfe76c0  5 mds.0.cache trim bytes_used=8GB limit=8GB reservation=0.05% count=0
8162     -7> 2026-06-30T09:13:58.867+0800 7fbf4ffeb6c0  5 mds.beacon.a Sending beacon up:active seq 11
8163     -6> 2026-06-30T09:13:58.867+0800 7fbf4ffeb6c0 10 monclient: _send_mon_message to mon.a at v2:192.168.0.106:40476/0
8164     -5> 2026-06-30T09:13:58.868+0800 7fbf51fef6c0  5 mds.beacon.a received beacon reply up:active seq 11 rtt 0.00100001
8165     -4> 2026-06-30T09:13:58.983+0800 7fbf50fed6c0 10 monclient: tick
8166     -3> 2026-06-30T09:13:58.983+0800 7fbf50fed6c0 10 monclient: _check_auth_tickets
8167     -2> 2026-06-30T09:13:58.983+0800 7fbf50fed6c0 10 monclient: _check_auth_rotating have uptodate secrets (they expire after 2026-06-30T09:13:28.984473+0800)
8168     -1> 2026-06-30T09:13:59.175+0800 7fbf4dfe76c0 -1 /home/xiubli/workspace/ceph/src/common/perf_counters.cc: In function 'void ceph::common::PerfCounters::inc(int, uint64_t)' thread 7fbf4dfe76c0 time 2026-06-30T09:13:59.161406+0800
8169 /home/xiubli/workspace/ceph/src/common/perf_counters.cc: 181: FAILED ceph_assert(idx > m_lower_bound)
8170 
8171  ceph version 21.3.0-509-g47c68516644 (47c68516644b16bae22f69f7395a22ed9da25510) umbrella (dev - Debug)
8172  1: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x11d) [0x7fbf57ea33cd]
8173  2: (ceph::__ceph_assert_fail(ceph::assert_data const&)+0x17) [0x7fbf57ea36cd]
8174  3: /home/xiubli/workspace/ceph/build/lib/libceph-common.so.2(+0x10daf7) [0x7fbf57f0daf7]
8175  4: (ceph::common::PerfCounters::inc(int, unsigned long)+0x5d) [0x7fbf57f0debf]
8176  5: (MDCache::trim_lru(unsigned long, std::map<int, boost::intrusive_ptr<MCacheExpire>, std::less<int>, std::allocator<std::pair<int const, boost::intrusive_ptr<MCacheExpire> > > >&)+0x5c2) [0x559d2d31883e]
8177  6: (MDCache::trim(unsigned long)+0x1e4) [0x559d2d318e6e]
8178  7: (MDCache::upkeep_main()+0x484) [0x559d2d34d1f0]
8179  8: (void std::__invoke_impl<void, void (MDCache::*)(), MDCache*>(std::__invoke_memfun_deref, void (MDCache::*&&)(), MDCache*&&)+0x25) [0x559d2d3ae0dd]
8180  9: (std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (MDCache::*)(), MDCache*> > >::_M_run()+0x11) [0x559d2d3ae0f3]
8181  10: /lib64/libstdc++.so.6(+0x523b6) [0x7fbf572523b6]
8182  11: /lib64/libc.so.6(+0x72d19) [0x7fbf57079d19]
8183  12: /lib64/libc.so.6(+0xf664c) [0x7fbf570fd64c]
8184 
8185      0> 2026-06-30T09:13:59.181+0800 7fbf4dfe76c0 -1 *** Caught signal (Aborted) **
8186  in thread 7fbf4dfe76c0 thread_name:mds-cache-trim
8187 
8188  ceph version 21.3.0-509-g47c68516644 (47c68516644b16bae22f69f7395a22ed9da25510) umbrella (dev - Debug)
8189  1: ./bin/ceph-mds(+0x3b84e7) [0x559d2d5664e7]
8190  2: /lib64/libc.so.6(+0x1a0b0) [0x7fbf570210b0]
8191  3: /lib64/libc.so.6(+0x74dcc) [0x7fbf5707bdcc]
8192  4: gsignal()
8193  5: abort()
8194  6: (ceph::__ceph_assert_fail(char const*, char const*, int, char const*)+0x2c5) [0x7fbf57ea3575]
8195  7: (ceph::__ceph_assert_fail(ceph::assert_data const&)+0x17) [0x7fbf57ea36cd]
8196  8: /home/xiubli/workspace/ceph/build/lib/libceph-common.so.2(+0x10daf7) [0x7fbf57f0daf7]
8197  9: (ceph::common::PerfCounters::inc(int, unsigned long)+0x5d) [0x7fbf57f0debf]
8198  10: (MDCache::trim_lru(unsigned long, std::map<int, boost::intrusive_ptr<MCacheExpire>, std::less<int>, std::allocator<std::pair<int const, boost::intrusive_ptr<MCacheExpire> > > >&)+0x5c2) [0x559d2d31883e]
8199  11: (MDCache::trim(unsigned long)+0x1e4) [0x559d2d318e6e]
8200  12: (MDCache::upkeep_main()+0x484) [0x559d2d34d1f0]
8201  13: (void std::__invoke_impl<void, void (MDCache::*)(), MDCache*>(std::__invoke_memfun_deref, void (MDCache::*&&)(), MDCache*&&)+0x25) [0x559d2d3ae0dd]
8202  14: (std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (MDCache::*)(), MDCache*> > >::_M_run()+0x11) [0x559d2d3ae0f3]
8203  15: /lib64/libstdc++.so.6(+0x523b6) [0x7fbf572523b6]
8204  16: /lib64/libc.so.6(+0x72d19) [0x7fbf57079d19]
8205  17: /lib64/libc.so.6(+0xf664c) [0x7fbf570fd64c]
8206  NOTE: a copy of the executable, or `objdump -rdS <executable>` is needed to interpret this.
8207 

All MDS ranks crash with the same assertion failure in the mds-cache-trim thread:

assert_condition: "idx > m_lower_bound" 
assert_func: "void ceph::common::PerfCounters::inc(int, uint64_t)" 
assert_file: "src/common/perf_counters.cc" 
assert_line: 181

Backtrace:

MDCache::upkeep_main()
  → MDCache::trim()
    → MDCache::trim_lru()
      → logger->inc(l_mdss_cache_trim_throttle)
        → PerfCounters::inc(idx)
          → ceph_assert(idx > m_lower_bound)   ← crash

Root cause:

MDCache::trim_lru() uses MDCache::logger to increment l_mdss_cache_trim_throttle, but this perf counter belongs to a different perf counter collection:

┌──────────────────┬──────────────────────────────────┬────────────────────────────┐
│                  │        Perf Counter Range        │ l_mdss_cache_trim_throttle │
├──────────────────┼──────────────────────────────────┼────────────────────────────┤
│ Server (owner)   │ [l_mdss_first=1000, l_mdss_last) │ ~1124 ✅ valid             │
├──────────────────┼──────────────────────────────────┼────────────────────────────┤
│ MDCache (caller) │ [l_mdc_first=3000, l_mdc_last)   │ ~1124 ❌ out of range      │
└──────────────────┴──────────────────────────────────┴────────────────────────────┘

PerfCounters::inc() subtracts m_lower_bound from the index. Since 1124 < 3000, the assertion idx > m_lower_bound fails.

This is a latent bug — the trim_lru() throttle path was rarely triggered, so the crash only manifests under specific cache pressure conditions.

Related issues 3 (1 open — 2 closed)

Copied to CephFS - Backport #79054: tentacle: MDS: perf_counters.cc: 181: FAILED ceph_assert(idx > m_lower_bound)RejectedXiubo Li

Actions
Copied to CephFS - Backport #79055: umbrella: MDS: perf_counters.cc: 181: FAILED ceph_assert(idx > m_lower_bound)Fix Under ReviewXiubo Li

Actions
Copied to CephFS - Backport #79056: squid: MDS: perf_counters.cc: 181: FAILED ceph_assert(idx > m_lower_bound)RejectedXiubo Li

Actions

XL Updated by Xiubo Li 5 months ago Actions #1

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 69831

XL Updated by Xiubo Li 5 months ago Actions #2

  • Source set to Community (dev)
  • Backport set to tentacle, squid, reef

VS Updated by Venky Shankar 5 months ago Actions #4

  • Category set to Correctness/Safety
  • Priority changed from High to Immediate
  • Target version set to v22.0.0
  • Backport changed from tentacle, squid, reef to tentacle, squid, umbrella

UB Updated by Upkeep Bot 4 months ago Actions #5

  • Status changed from Fix Under Review to Pending Backport
  • Merge Commit set to bb2afd0a19f1426b9ef438cc6d4a839465ceb55d
  • Fixed In set to v21.3.0-1748-gbb2afd0a19
  • Upkeep Timestamp set to 2026-08-05T05:45:48+00:00

UB Updated by Upkeep Bot 4 months ago Actions #6

  • Copied to Backport #79054: tentacle: MDS: perf_counters.cc: 181: FAILED ceph_assert(idx > m_lower_bound) added

UB Updated by Upkeep Bot 4 months ago Actions #7

  • Copied to Backport #79055: umbrella: MDS: perf_counters.cc: 181: FAILED ceph_assert(idx > m_lower_bound) added

UB Updated by Upkeep Bot 4 months ago Actions #8

  • Copied to Backport #79056: squid: MDS: perf_counters.cc: 181: FAILED ceph_assert(idx > m_lower_bound) added

UB Updated by Upkeep Bot 4 months ago Actions #9

  • Tags (freeform) set to backport_processed

UB Updated by Upkeep Bot 3 months ago Actions #10

  • Status changed from Pending Backport to Backporting
  • Tags (freeform) deleted (backport_processed)
  • Upkeep Timestamp changed from 2026-08-05T05:45:48+00:00 to 2026-08-27T18:44:09+00:00
Actions

Also available in: PDF Atom