Project

General

Profile

Actions

Bug #79440

closed
IG IG

MDS crash: ceph_assert(rm) in MetricAggregator::remove_metrics_for_rank during max_mds scaling

Bug #79440: MDS crash: ceph_assert(rm) in MetricAggregator::remove_metrics_for_rank during max_mds scaling

Added by Igor Golikov 4 months ago. Updated 3 months ago.

Status:
Pending Backport
Priority:
Normal
Assignee:
Category:
Correctness/Safety
Target version:
Due date:
% Done:

0%

Source:
Development
Backport:
umbrella,tentacle,squide
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
MDS
Labels (FS):
crash
Pull request ID:
Tags (freeform):
upkeep-failed
Fixed In:
v21.3.0-2768-g7b7b3e93b7
Released In:
Upkeep Timestamp:
2026-09-01T07:27:08+00:00

Description

Description

MDS rank 0 crashes with FAILED ceph_assert(rm) in MetricAggregator::remove_metrics_for_rank() while handling an UPDATE_TYPE_REMOVE client metrics update.

The assert fails when the client is not present in clients_by_rank[rank] — either it was never tracked, or it was already removed (e.g. after rank cull/recycle during max_mds changes):

ceph_assert(rm);  // rm = (clients_by_rank[rank].erase(client) != 0)

Call path:

MetricAggregator::ms_dispatch2
  -> handle_mds_metrics
    -> remove_metrics_for_rank(..., remove=true)

Version

Observed on tentacle (v20.2.x). Not confirmed whether this is a regression.

Impact

The affected MDS is restarted by the orchestrator and the cluster can return to HEALTH_OK. This is not a steady-state I/O failure; it is triggered during MDS rank lifecycle transitions (max_mds changes / failover).

Workaround

None known. Avoid rapid/repeated max_mds changes under heavy session/metrics load if possible.

Steps to Reproduce

Hit rate: observed once during a multi-step MDS scaling session; exact minimal repro not isolated.

Approximate sequence:

  1. Deploy CephFS with many active MDS ranks (e.g. 16) and a large number of subvolumes/client sessions, with distributed pinning enabled
  2. Run metadata/data fill workloads across subvolumes, then stop workloads and drain client sessions
  3. Fail over rank 0 (ceph mds fail 0)
  4. Reduce max_mds (e.g. 16 -> 12) and wait for subtree migration
  5. Restart/stop workloads again; fail over rank 0 again
  6. Reduce max_mds further (e.g. toward 8); if ranks stall in up:stopping, roll max_mds back up (e.g. to 16)
  7. Observe crash on the rank-0 MDS in MetricAggregator::remove_metrics_for_rank

Actual results

MDS crashes on ceph_assert(rm) in MetricAggregator::remove_metrics_for_rank().

Expected results

MDS should tolerate remove of a client that is not (or no longer) present in clients_by_rank and continue running. Missing-client remove should be treated as an idempotent no-op (log and skip teardown), not an assert.

Additional information

  • Appears related to rank removal/re-add and metrics bookkeeping around cull_metrics_for_rank() / UPDATE_TYPE_REMOVE races during max_mds scaling and failover.
  • Same test session also hit MDS ranks stuck in up:stopping after max_mds reduction (tracked separately).

Related issues 1 (1 open — 0 closed)

Copied to CephFS - Backport #80154: umbrella: MDS crash: ceph_assert(rm) in MetricAggregator::remove_metrics_for_rank during max_mds scalingFix Under ReviewIgor Golikov

Actions

IG Updated by Igor Golikov 4 months ago Actions #1

Confirmed bug.

During max_mds / failover churn, rank 0 can receive UPDATE_TYPE_REMOVE for a client that is not in clients_by_rank (never refreshed, already culled, or rank recycled). remove_metrics_for_rank() currently does ceph_assert(rm) on that miss and crashes.

This is metrics bookkeeping only; FS correctness is unaffected. The assert is too strict.

Solution: treat missing client as an idempotent no-op — if the client (or rank) is not tracked, log and return without tearing down perf counters or decrementing num_clients. Only run the existing cleanup when erase actually removes the client.

IG Updated by Igor Golikov 4 months ago Actions #2

  • Status changed from New to Fix Under Review
  • Pull request ID set to 71013

VS Updated by Venky Shankar 4 months ago Actions #3

  • Category set to Correctness/Safety
  • Target version set to v22.0.0
  • Source set to Development
  • Backport set to umbrella,tentacle,squide
  • Labels (FS) crash added

UB Updated by Upkeep Bot 3 months ago Actions #4

  • Status changed from Fix Under Review to Pending Backport
  • Merge Commit set to 7b7b3e93b729fd97549faa27d9e3afae6486e569
  • Fixed In set to v21.3.0-2768-g7b7b3e93b7
  • Upkeep Timestamp set to 2026-09-01T07:27:08+00:00

UB Updated by Upkeep Bot 3 months ago Actions #5

  • Copied to Backport #80154: umbrella: MDS crash: ceph_assert(rm) in MetricAggregator::remove_metrics_for_rank during max_mds scaling added

UB Updated by Upkeep Bot 3 months ago Actions #6

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 create_backports transformation.

Update Log

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

Error

Redmine Update failed:

Traceback (most recent call last):
  File "<string>", line 1120, in _transform_create_backports
    other = self.R.issue.create(**create_args)
  File "/home/batrick/ptl-venv/lib/python3.14/site-packages/redminelib/managers/base.py", line 187, in create
    response = self.redmine.engine.request(self.resource_class.http_method_create, url, data=request)
  File "/home/batrick/ptl-venv/lib/python3.14/site-packages/redminelib/engines/base.py", line 84, in request
    return self.process_response(self.session.request(method, url, **kwargs))
           ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/batrick/ptl-venv/lib/python3.14/site-packages/redminelib/engines/base.py", line 188, in process_response
    raise exceptions.ValidationError(', '.join(': '.join(e) if isinstance(e, list) else e for e in errors))
redminelib.exceptions.ValidationError: Ceph release is not included in the list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1126, in _transform_create_backports
    other = self.R.issue.create(**create_args)
  File "/home/batrick/ptl-venv/lib/python3.14/site-packages/redminelib/managers/base.py", line 187, in create
    response = self.redmine.engine.request(self.resource_class.http_method_create, url, data=request)
  File "/home/batrick/ptl-venv/lib/python3.14/site-packages/redminelib/engines/base.py", line 84, in request
    return self.process_response(self.session.request(method, url, **kwargs))
           ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/batrick/ptl-venv/lib/python3.14/site-packages/redminelib/engines/base.py", line 188, in process_response
    raise exceptions.ValidationError(', '.join(': '.join(e) if isinstance(e, list) else e for e in errors))
redminelib.exceptions.ValidationError: Ceph release is not included in the list

UB Updated by Upkeep Bot 3 months ago Actions #7

  • Tags (freeform) set to upkeep-failed

Redmine Upkeep failure

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

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

Transformation

The script was in the create_backports transformation.

Update Log

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

Error

Redmine Update failed:

Traceback (most recent call last):
  File "/home/runner/work/ceph/ceph/ceph/src/script/redmine-upkeep.py", line 1002, in _transform_create_backports
    other = self.R.issue.create(**create_args)
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/managers/base.py", line 187, in create
    response = self.redmine.engine.request(self.resource_class.http_method_create, url, data=request)
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/engines/base.py", line 83, in request
    return self.process_response(self.session.request(method, url, **kwargs))
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/engines/base.py", line 178, in process_response
    raise exceptions.ValidationError(', '.join(': '.join(e) if isinstance(e, list) else e for e in errors))
redminelib.exceptions.ValidationError: Ceph release is not included in the list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/work/ceph/ceph/ceph/src/script/redmine-upkeep.py", line 1008, in _transform_create_backports
    other = self.R.issue.create(**create_args)
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/managers/base.py", line 187, in create
    response = self.redmine.engine.request(self.resource_class.http_method_create, url, data=request)
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/engines/base.py", line 83, in request
    return self.process_response(self.session.request(method, url, **kwargs))
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/site-packages/redminelib/engines/base.py", line 178, in process_response
    raise exceptions.ValidationError(', '.join(': '.join(e) if isinstance(e, list) else e for e in errors))
redminelib.exceptions.ValidationError: Ceph release is not included in the list
Actions

Also available in: PDF Atom