Skip to content

mon: drop messages from unranked peers in quorum - #73106

Open
kamoltat wants to merge 1 commit into
ceph:mainfrom
kamoltat:wip-ksirivad-fix-81588
Open

kamoltat wants to merge 1 commit into
ceph:mainfrom
kamoltat:wip-ksirivad-fix-81588

Conversation

@kamoltat

@kamoltat kamoltat commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Problem:
A monitor outside the monmap can authenticate and keep exchanging messages with quorum members. Drop its messages and close the connection while we are in quorum, without changing discovery during bootstrap.

From tracker 81588
A ceph-mon was running on a host that is listed in mon_host and has a [mon.c] section in ceph.conf, but that is NOT a member of the monmap. It held the cluster's valid mon. keyring, so both quorum mons authenticated it, and it exchanged ~19,000 messages per second with each of them indefinitely. Both quorum mons grew without bound in the buffer_anon mempool, at roughly 35-39 MB/s (~130 GiB/hour), until the kernel OOM-killed them (observed at ~243 GiB RSS). With a 2-mon monmap, this repeatedly took the whole cluster offline. Stopping the stray daemon stopped the growth immediately.

The stray mon came from a misconfiguration. Even so, a single unranked peer should not be able to cause unbounded memory growth on the quorum mons which took down the cluster every hour and a half.

Solution:
Add a guard against a mon that doesn't exist in monmap

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

Assisted-by: Copilot
Signed-off-by: Kamoltat (Junior) Sirivadhna [email protected]

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.

A monitor outside the monmap can authenticate and keep exchanging messages with quorum members. Drop its messages and close the connection while we are in quorum, without changing discovery during bootstrap.

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

Assisted-by: Copilot
Signed-off-by: Kamoltat (Junior) Sirivadhna <[email protected]>
@kamoltat kamoltat self-assigned this Oct 26, 2026
@kamoltat
kamoltat requested a review from a team as a code owner October 26, 2026 15:56
@kamoltat kamoltat added needs-review needs-umbrella-backport This PR should be backported to Umbrella needs-tentacle-backport PRs that need tentacle back-port needs-squid-backport PR needs a squid backport labels Oct 26, 2026
@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been added to wip-bharath9-testing-20261027.065249-main.

@amathuria

Copy link
Copy Markdown
Contributor

@kamoltat I am seeing a few failures - time outs happening while waiting for monitors:

https://pulpito.ceph.com/skanta-2026-11-04_12:54:04-rados-wip-bharath9-testing-20261104.043109-main-distro-default-trial/712424/

2026-11-04T13:11:55.738 INFO:tasks.cephadm:Waiting for 3 mons in monmap...
2026-11-04T13:11:55.738 DEBUG:teuthology.orchestra.run.trial191:> sudo /home/ubuntu/cephtest/cephadm --image quay.ceph.io/ceph-ci/ceph:34f6c4a9b524ec00a1e114ac9028d5d1123f8913 shell -c /etc/ceph/ceph.conf -k /etc/ceph/ceph.client.admin.keyring --fsid 96142af1-d850-11f1-aee9-d404e6e7d460 -- ceph mon dump -f json
2026-11-04T13:11:55.827 INFO:[email protected]:Nov 04 13:11:55 trial044 ceph-mon[15838]: from='client.? 10.20.193.191:0/99302042' entity='client.admin' cmd={"prefix": "mon dump", "format": "json"} : dispatch
2026-11-04T13:11:55.859 INFO:teuthology.orchestra.run.trial191.stderr:Inferring config /var/lib/ceph/96142af1-d850-11f1-aee9-d404e6e7d460/mon.c/config
2026-11-04T13:11:56.134 INFO:teuthology.orchestra.run.trial191.stdout:
2026-11-04T13:11:56.134 INFO:teuthology.orchestra.run.trial191.stdout:{"epoch":1,"auth_epoch":0,"auth_service_cipher":{"name":"aes256k","value":2},"auth_allowed_ciphers":[{"name":"aes256k","value":2}],"auth_preferred_cipher":{"name":"aes256k","value":2},"fsid":"96142af1-d850-11f1-aee9-d404e6e7d460","modified":"2026-11-04T13:06:57.396643Z","created":"2026-11-04T13:06:57.396643Z","min_mon_release":22,"min_mon_release_name":"vampire","election_strategy":1,"disallowed_leaders":"","stretch_mode":false,"tiebreaker_mon":"","removed_ranks":"","features":{"persistent":["kraken","luminous","mimic","osdmap-prune","nautilus","octopus","pacific","elector-pinging","quincy","reef","squid","tentacle","umbrella","vampire","cephx_auth_aes256k","nvmeof_beacon_diff"],"optional":[]},"mons":[{"rank":0,"name":"a","public_addrs":{"addrvec":[{"type":"v2","addr":"10.20.193.44:3300","nonce":0},{"type":"v1","addr":"10.20.193.44:6789","nonce":0}]},"addr":"10.20.193.44:6789/0","public_addr":"10.20.193.44:6789/0","priority":0,"weight":0,"time_added":"2026-11-04T13:06:57:396651+0000","crush_location":[]}],"quorum":[0]}
2026-11-04T13:11:56.134 INFO:teuthology.orchestra.run.trial191.stderr:dumped monmap epoch 1
2026-11-04T13:11:56.172 ERROR:teuthology.contextutil:Saw exception from nested tasks
Traceback (most recent call last):
  File "/home/teuthworker/src/git.ceph.com_teuthology_7ed59cb8cb032efd27fbb537aa972a0740752479/teuthology/contextutil.py", line 30, in nested
    vars.append(enter())
                ^^^^^^^
  File "/usr/lib/python3.12/contextlib.py", line 137, in __enter__
    return next(self.gen)
           ^^^^^^^^^^^^^^
  File "/home/teuthworker/src/github.com_ceph_ceph-ci_34f6c4a9b524ec00a1e114ac9028d5d1123f8913/qa/tasks/cephadm.py", line 1032, in ceph_mons
    while proceed():
          ^^^^^^^^^
  File "/home/teuthworker/src/git.ceph.com_teuthology_7ed59cb8cb032efd27fbb537aa972a0740752479/teuthology/contextutil.py", line 134, in __call__
    raise MaxWhileTries(error_msg)
teuthology.exceptions.MaxWhileTries: reached maximum tries (180) after waiting for 180 seconds

Could you take a look in case it is related?

@SrinivasaBharath

Copy link
Copy Markdown
Contributor

This PR has been removed from wip-bharath9-testing-20261027.065249-main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core mon needs-squid-backport PR needs a squid backport needs-tentacle-backport PRs that need tentacle back-port needs-umbrella-backport This PR should be backported to Umbrella

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants