Skip to content

mds: delay cache rejoin OP_WEAK until peer is in rejoin - #71643

Merged
vshankar merged 2 commits into
ceph:mainfrom
salieri11:igolikov-fix-weak-rejoin-bug-54840
Nov 10, 2026
Merged

vshankar merged 2 commits into
ceph:mainfrom
salieri11:igolikov-fix-weak-rejoin-bug-54840

Conversation

@salieri11

Copy link
Copy Markdown
Contributor

A deferred rejoin_send_rejoins() can send OP_WEAK while a peer is still in resolve or reconnect, crashing the receiver on
ceph_assert(mds->is_rejoin()). Defer handling until rejoin_start(), skip sending OP_WEAK to peers below STATE_REJOIN, keep rejoins_pending, and retry when a peer reaches rejoin.

Fixes: https://tracker.ceph.com/issues/54840

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@github-actions github-actions Bot added the cephfs Ceph File System label Sep 9, 2026
@salieri11
salieri11 requested a review from vshankar September 9, 2026 07:06
@vshankar
vshankar requested a review from xiubli September 15, 2026 16:40
Comment thread src/mds/MDCache.cc Resolved
Comment thread src/mds/MDSRank.cc Resolved
Comment thread src/mds/MDCache.cc Resolved
Comment thread src/mds/MDCache.cc Resolved
@vshankar vshankar self-assigned this Oct 23, 2026
Comment thread src/mds/MDSRank.cc Resolved

@vshankar vshankar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment. Otherwise LGTM and is good to run through QA (once the pending comments reach conclusion).

Comment thread src/mds/MDCache.cc Resolved
@salieri11
salieri11 force-pushed the igolikov-fix-weak-rejoin-bug-54840 branch from 9514602 to cda62ed Compare November 3, 2026 09:57
@salieri11
salieri11 requested a review from a team as a code owner November 3, 2026 09:57
@salieri11

Copy link
Copy Markdown
Contributor Author

@vshankar all comments have been addressed

@salieri11

Copy link
Copy Markdown
Contributor Author

jenkins test make check

1 similar comment
@salieri11

Copy link
Copy Markdown
Contributor Author

jenkins test make check

vshankar and others added 2 commits November 5, 2026 12:41
Hold rejoin_send_rejoins() until mds_defer_rejoin_send_for_testing is
cleared, so a peer can fail and return below rejoin before the weak
rejoin is sent. The failover test releases that hold while the peer is
still replaying.

Fixes: https://tracker.ceph.com/issues/54840
Signed-off-by: Venky Shankar <[email protected]>
A deferred rejoin_send_rejoins() can send OP_WEAK while a peer is still
below rejoin, crashing the receiver on ceph_assert(mds->is_rejoin()).
Skip OP_WEAK for every rank below STATE_REJOIN, including a failed rank,
keep rejoins_pending, and retry from handle_mds_map only while this rank
is in rejoin and a send was deferred. On the receiver, defer the message
until rejoin_start() instead of asserting.

Fixes: https://tracker.ceph.com/issues/54840
Signed-off-by: Igor Golikov <[email protected]>
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Config Diff Tool Output

+ added: mds_defer_rejoin_send_for_testing (mds.yaml.in)

The above configuration changes are found in the PR. Please update the relevant release documentation if necessary.
Ignore this comment if docs are already updated. To make the "Check ceph config changes" CI check pass, please comment /config check ok and re-run the test.

@vshankar

vshankar commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Squashed the 3 commits and added a test reproducer. The issue reproduces without this fix. See: https://pulpito.ceph.com/vshankar-2026-11-04_16:46:13-fs:functional-wip-weak-rejoin-crash-distro-default-trial/714875/

And with the fix the test passes.

@salieri11

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@vshankar

vshankar commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

This PR has been added to main integration testing by vshankar started 2026-11-06-10:30.

@vshankar vshankar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vshankar

Copy link
Copy Markdown
Contributor

jenkins test api

@vshankar
vshankar merged commit 74db8b7 into ceph:main Nov 10, 2026
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants