Skip to content

squid: mds: fix crash and shutdown hang when ephemeral pins active and max_mds is 0 - #69485

Merged
batrick merged 2 commits into
ceph:squidfrom
vshankar:wip-77259-squid
Oct 26, 2026
Merged

batrick merged 2 commits into
ceph:squidfrom
vshankar:wip-77259-squid

Conversation

@vshankar

Copy link
Copy Markdown
Contributor

@vshankar vshankar added this to the squid milestone Jun 15, 2026
@vshankar vshankar added the cephfs Ceph File System label Jun 15, 2026
@github-actions github-actions Bot added the releng-audit-pass Release engineering: passed backport verification audit. label Jun 15, 2026
@vshankar

Copy link
Copy Markdown
Contributor Author

jenkins test make check

2 similar comments
@vshankar

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@vshankar

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@github-actions github-actions Bot added releng-audit-pass Release engineering: passed backport verification audit. and removed releng-audit-pass Release engineering: passed backport verification audit. labels Jun 19, 2026
@vshankar

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@vshankar

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@joscollin

Copy link
Copy Markdown
Member

@vshankar Please rebase and push?

@github-actions github-actions Bot removed the releng-audit-pass Release engineering: passed backport verification audit. label Jun 26, 2026
@vshankar

Copy link
Copy Markdown
Contributor Author

@vshankar Please rebase and push?

Done.

@github-actions github-actions Bot added the releng-audit-pass Release engineering: passed backport verification audit. label Jun 26, 2026
@vshankar

vshankar commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@vshankar

vshankar commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

jenkins retest this please

@yuriw

yuriw commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to wip-yuri7-testing-20261007.155121-squid.

@vshankar

Copy link
Copy Markdown
Contributor Author

@vshankar

Copy link
Copy Markdown
Contributor Author

Reviewed-by: Venky Shankar [email protected]

When a CephFS cluster is paused (e.g. via `ceph fs set <fs> down true`
or `ceph fs pause`) the MDS map's max_mds is set to 0.  Any subsequent
call to hash_into_rank_bucket() with max_mds == 0 triggers a crash:
the jump-consistent-hash loop never executes (j starts at 0, condition
j < max_mds is immediately false), leaving b = -1, so the final
assert(result >= 0 && result < max_mds) aborts the daemon.

Fixes: https://tracker.ceph.com/issues/76059
Signed-off-by: chungfengz <[email protected]>
(cherry picked from commit de9db7c)
During shutdown, `ceph fs set <fs> down true` sets max_mds to 0 before
the MDS daemons have finished exporting their subtrees.  shutdown_pass()
iterates over auth subtrees and skips any dir whose inode is
ephemerally pinned, expecting handle_export_pins() to re-place them.
However, handle_export_pins() calls hash_into_rank_bucket() which (after
the companion fix) now returns MDS_RANK_NONE when max_mds == 0.  With
no valid target rank the export is never scheduled, so the ephemerally-
pinned dirs are skipped by shutdown_pass() indefinitely and the daemon
loops.

Fixes: https://tracker.ceph.com/issues/76059
Signed-off-by: chungfengz <[email protected]>
(cherry picked from commit 039eba3)
@batrick batrick modified the milestones: squid, v19.2.8 Oct 26, 2026
@github-actions github-actions Bot added releng-audit-pass Release engineering: passed backport verification audit. and removed releng-audit-pass Release engineering: passed backport verification audit. labels Oct 26, 2026
@batrick
batrick merged commit 8d5492d into ceph:squid Oct 26, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cephfs Ceph File System needs-qa releng-audit-pass Release engineering: passed backport verification audit. wip-yuri7-testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants