Bug #79440
closedMDS crash: ceph_assert(rm) in MetricAggregator::remove_metrics_for_rank during max_mds scaling
0%
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:
- Deploy CephFS with many active MDS ranks (e.g. 16) and a large number of subvolumes/client sessions, with distributed pinning enabled
- Run metadata/data fill workloads across subvolumes, then stop workloads and drain client sessions
- Fail over rank 0 (
ceph mds fail 0) - Reduce
max_mds(e.g. 16 -> 12) and wait for subtree migration - Restart/stop workloads again; fail over rank 0 again
- Reduce
max_mdsfurther (e.g. toward 8); if ranks stall inup:stopping, rollmax_mdsback up (e.g. to 16) - 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_REMOVEraces duringmax_mdsscaling and failover. - Same test session also hit MDS ranks stuck in
up:stoppingaftermax_mdsreduction (tracked separately).
IG Updated by Igor Golikov 4 months ago
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
- Status changed from New to Fix Under Review
- Pull request ID set to 71013
VS Updated by Venky Shankar 4 months ago
- 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
- 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
- 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
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¶
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
- 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¶
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