Project

General

Profile

Actions

Bug #81604

closed
YS

mon: zero-fsid MLog leaks a routed request; #61933 workaround drops all log acks for peon clients

Bug #81604: mon: zero-fsid MLog leaks a routed request; #61933 workaround drops all log acks for peon clients

Added by yulong shi about 2 months ago. Updated 21 days ago.

Status:
Backporting
Priority:
High
Assignee:
-
Category:
Monitor
Target version:
Due date:
% Done:

0%

Source:
Community (user)
Backport:
umbrella, tentacle, squid
Regression:
Yes
Severity:
3 - minor
Reviewed:
ceph-qa-suite:
Component(RADOS):
Monitor
Pull request ID:
Tags (freeform):
Fixed In:
v22.0.0-437-g7d8e945aa3
Released In:
Upkeep Timestamp:
2026-11-04T20:50:46+00:00

Description

Summary

A forwarded MLog whose fsid is all zeros is dropped by the leader in LogMonitor::prepare_log() without any reply. The peon that forwarded it keeps the RoutedRequest forever, which shows up as a permanent SLOW_OPS on that peon.

PR #61933 (the fix for #54489) works around this by calling no_reply() at the top of LogMonitor::preprocess_log() for every MLog. That removes the slow op, but it also introduces a regression: every daemon connected to a peon (OSDs, the mgr, and the peon mons themselves) never receives an MLogAck again, so its LogClient::log_queue grows without bound.

This issue describes the actual root cause, shows reproduction data for the regression, and proposes to revert #61933 and reply where the message is actually dropped (a one-line change).

1. Symptom

A peon monitor reports a slow op that never clears (observed on a Pacific-based build; the code paths below are unchanged in main):

# ceph health detail
HEALTH_WARN 1 slow ops, oldest one blocked for 165868 sec, mon.node-3 has slow ops
[WRN] SLOW_OPS: 1 slow ops, oldest one blocked for 165868 sec, mon.node-3 has slow ops

The leader is mon.node-1 (rank 0); mon.node-3 is a peon. The stuck op on the peon (filtered from ceph daemon mon.node-3 ops):

description : log(1 entries from seq 2 at 2026-10-08T15:22:18.911369+0800)
initiated_at: 2026-10-08T15:22:22.350383+0800
age (sec)   : 165895
source      : osd.6 v2:192.168.1.66:6808/4428
forwarded   : True
events      : initiated -> throttled -> header_read -> all_read -> dispatched -> mon:_ms_dispatch -> mon:dispatch_op -> psvc:dispatch -> logm:preprocess_query -> logm:preprocess_log -> forward_request_leader -> forwarded -> resend forwarded message to leader -> resend forwarded message to leader

It is an MLog from osd.6 that the peon forwarded to the leader. The peon keeps a RoutedRequest for it until the leader answers with an MRoute, and that MRoute never arrives.

2. Root cause

2.1 The leader drops the MLog without replying, because its fsid is all zeros

Leader log at the exact moment the peon forwarded the message:

2026-10-08T15:22:22.350+0800 7f4affc55640 WARNING mon.node-1@0(leader).log v192466 handle_log on fsid 00000000-0000-0000-0000-000000000000 != 72df7ab3-da67-4f9e-b489-105618ba5591

This comes from LogMonitor::prepare_log(). On an fsid mismatch it returns false without calling no_reply() or send_reply(). So no MRoute is sent back to the peon, and the peon's RoutedRequest leaks.

The fsid in ceph.conf is correct on every node:

node-1: fsid = 72df7ab3-da67-4f9e-b489-105618ba5591
node-2: fsid = 72df7ab3-da67-4f9e-b489-105618ba5591
node-3: fsid = 72df7ab3-da67-4f9e-b489-105618ba5591

2.2 Why osd.6 sent fsid 00000000-...

Timeline:

2026-10-08 15:21:57       host node-3 (runs mon.node-3 and osd.6) rebooted
2026-10-08T15:22:16.580   mon.node-1 calling monitor election
2026-10-08T15:22:21.553   mon.node-1 is new leader, mons node-1,node-3,node-2 in quorum
2026-10-08T15:22:22.350   osd.6's MLog (entry queued at 15:22:18.911) forwarded by mon.node-3;
                          leader: handle_log on fsid 00000000-...
2026-10-08T15:22:23.680   osd.6 [v2:192.168.1.66:6808/4428,v1:192.168.1.66:6809/4428] boot

osd.6 queued a cluster log entry while it was waiting for the mons. It sent that entry the moment its mon session was established, which was before it received the real monmap:

  1. global_init() runs a bootstrap MonClient (global_init.cc#L415). Its handle_monmap() stores the mon addresses in the CephContext (MonClient.cc#L487).
  2. The OSD's own MonClient then calls MonMap::build_initial(). Because cct->get_mon_addrs() is not empty, it takes the "cct?" branch and returns early (MonMap.cc#L1130-L1135). That skips the "fsid from conf?" block further down (MonMap.cc#L1143-L1147), so monc->monmap.fsid stays zero.
  3. As soon as authentication completes, MonClient::_finish_hunting() flushes the queued log entries with send_log(true) (MonClient.cc#L1029), before the real monmap has arrived. The OSD's LogClient reads the fsid from &mc->monmap (OSD.cc#L2422), so the MLog carries fsid 0.

The window is short, and normally nothing is queued yet, so this needs a daemon that queues a cluster log entry before its first mon session. Examples are a host reboot while the mons are not yet in quorum, or a freshly deployed OSD. The latter is likely the same trigger as the "remove and re-add OSDs with --zap --force" scenario in #54489.

3. Why PR #61933 is not a correct fix

#61933 changes preprocess_log() to always call mon.no_reply(op), also when the MLog has new entries:

-  return false;
-
- done:
-  mon.no_reply(op);
-  return true;
+  done:
+    mon.no_reply(op);
+    return (!num_new);

For a forwarded MLog, no_reply() on the leader sends an empty MRoute to the peon (Monitor.cc#L4521), and the peon erases the RoutedRequest. That does clear the slow op. But on the normal path the leader then commits the entries and calls _updated_log() -> send_reply(), which sends a second MRoute that carries the MLogAck. By then the peon has already erased the RoutedRequest, so handle_route() discards it (Monitor.cc#L4560-L4564):

  auto found = routed_requests.find(m->session_mon_tid);
  if (found == routed_requests.end()) {
    dout(10) << " don't have routed request tid " << m->session_mon_tid << dendl;
    return;
  }

As a result, no daemon connected to a peon ever receives an MLogAck. LogClient::log_queue has no size limit and is only trimmed in handle_log_ack() (LogClient.cc#L338-L351), so the queue grows forever in the mgr, the OSDs, and the peon mons' own LogClient.

Note that "the next ack will cover it" does not apply here: acks are cumulative, but a client connected to a peon receives none at all.

The #61933 review only discussed the empty MRoute; the dropped MLogAck was not mentioned.

4. Reproduction of the regression

Test cluster: 3 hosts, 3 mons (leader mon.node-1), 1 OSD per host, 1 active mgr. Build: Pacific with #61933 cherry-picked (the code involved is identical to main). Cluster log entries are generated with ceph daemon osd.N scrub_purged_snaps (2 entries per call), and the queue is observed with debug_monc = 10 and debug_mon = 10.

Topology during the test:

mon.node-1 (leader): osd.0
mon.node-2 (peon)  : osd.2, mgr
mon.node-3 (peon)  : osd.1

4.1 OSD queues: the leader client is acked, the peon clients never are

== osd.0 (connected to the leader)
13:30:26.366 log_client  log_queue is 2 last_log 20 sent 18 num 2 unsent 2 sending 2
13:30:26.827 log_client handle_log_ack log(last 20) v1
13:30:30.367 log_client  log_queue is 2 last_log 22 sent 20 num 2 unsent 2 sending 2
13:30:31.148 log_client handle_log_ack log(last 22) v1
...
13:30:42.370 log_client  log_queue is 2 last_log 28 sent 26 num 2 unsent 2 sending 2
13:30:43.164 log_client handle_log_ack log(last 28) v1

== osd.1 (connected to peon node-3)
13:30:26.675 log_client  log_queue is 10 last_log 10 sent 8 num 10 unsent 2 sending 2
13:30:30.676 log_client  log_queue is 12 last_log 12 sent 10 num 12 unsent 2 sending 2
13:30:34.677 log_client  log_queue is 14 last_log 14 sent 12 num 14 unsent 2 sending 2
13:30:38.678 log_client  log_queue is 16 last_log 16 sent 14 num 16 unsent 2 sending 2
13:30:42.685 log_client  log_queue is 18 last_log 18 sent 16 num 18 unsent 2 sending 2

== osd.2 (connected to peon node-2)
13:30:27.084 log_client  log_queue is 20 last_log 20 sent 18 num 20 unsent 2 sending 2
...
13:30:43.088 log_client  log_queue is 28 last_log 28 sent 26 num 28 unsent 2 sending 2

osd.0's queue stays at 2 and every batch is acked. osd.1 and osd.2 never get an ack, and their queue size equals last_log.

4.2 One forwarded MLog traced end to end (osd.1, routed tid 29)

13:30:26.676 mon.node-3@2(peon)   forward_request 29 request log(2 entries from seq 9 at 2026-10-10T13:30:25.904724+0800)
13:30:26.677 mon.node-1@0(leader) no_reply to osd.1 v2:192.168.2.232:6802/16805 via v2:192.168.2.233:3300/0 for request log(2 entries from seq 9 ...)
13:30:26.677 mon.node-3@2(peon)   handle_route tid 29 null
13:30:26.827 mon.node-3@2(peon)   handle_route tid 29 log(last 10) v1
13:30:26.827 mon.node-3@2(peon)   don't have routed request tid 29

In the same window, all forwarded MLog acks were dropped on both peons: node-2 forwarded 21 MLogs and dropped 20 acks; node-3 forwarded 7 and dropped 8 (the counts differ by one because of the window boundaries).

4.3 mgr and peon mons are affected as well

== mgr (connected to a peon; one pgmap entry every 2 s)
13:30:48.227 log_client  log_queue is 1745 last_log 1745 sent 1744 num 1745 unsent 1 sending 1
13:30:50.227 log_client  log_queue is 1746 last_log 1746 sent 1745 num 1746 unsent 1 sending 1
13:30:52.228 log_client  log_queue is 1747 last_log 1747 sent 1746 num 1747 unsent 1 sending 1

== mon.node-1 (leader, own cluster log)
13:30:51.745 log_client handle_log_ack log(last 204) v1

== mon.node-2 (peon, own cluster log)
13:30:51.981 log_client  log_queue is 53 last_log 53 sent 52 num 53 unsent 1 sending 1

== mon.node-3 (peon, own cluster log)
13:30:52.297 log_client  log_queue is 13 last_log 13 sent 12 num 13 unsent 1 sending 1

The mgr has never received an ack since it started (queue size == last_log). At one pgmap entry every 2 s, that is about 43k entries per day that are never freed.

Restarting a client only resets the queue. After restarting osd.1 it reconnected to a peon, and the queue grew again from 0 (2 -> 4 -> 6 -> 8) with no ack.

5. Proposed fix

  1. Revert #61933, so that preprocess_log() only calls no_reply() when the MLog is finished there (no new entries, or no permission). The normal path again acks through _updated_log() -> send_reply().
  2. Reply on the path that actually leaks. In prepare_log(), call no_reply() when the fsid does not match:
--- a/src/mon/LogMonitor.cc
+++ b/src/mon/LogMonitor.cc
@@ bool LogMonitor::prepare_log(MonOpRequestRef op)
   if (m->fsid != mon.monmap->fsid) {
     dout(0) << "handle_log on fsid " << m->fsid << " != " << mon.monmap->fsid
         << dendl;
+    mon.no_reply(op);
     return false;
   }

This releases the peon's RoutedRequest for the dropped message, and leaves the ack path for valid messages unchanged.

6. Related

  • #54489: mon ops stuck in "resend forwarded message to leader" (fixed by #61933)
  • PR #61933: LogMonitor: set no_reply for forward MLog commands (merged, backported to reef and squid)
  • #22114: same class of bug for MSG_MGR_BEACON / MSG_OSD_BEACON / MSG_OSD_PG_CREATED (missing no_reply on forwarded messages)

Related issues 4 (3 open — 1 closed)

Has duplicate RADOS - Bug #81511: mon/LogMonitor: since v19.2.3, MLogAck for MLog forwarded by a peon is dropped; client log queues grow forever and are resent in full on every mon reconnectDuplicateNitzan Mordechai

Actions
Copied to RADOS - Backport #82683: tentacle: mon: zero-fsid MLog leaks a routed request; #61933 workaround drops all log acks for peon clientsIn ProgressDan van der Ster

Actions
Copied to RADOS - Backport #82684: squid: mon: zero-fsid MLog leaks a routed request; #61933 workaround drops all log acks for peon clientsIn Progress

Actions
Copied to RADOS - Backport #82685: umbrella: mon: zero-fsid MLog leaks a routed request; #61933 workaround drops all log acks for peon clientsIn Progress

Actions

YS Updated by yulong shi about 2 months ago Actions #1

  • Pull request ID set to 72555
  • Affected Versions v21.0.0 added
  • Affected Versions deleted (v16.2.14, v16.2.15, v17.2.6, v17.2.7, v17.2.8, v18.0.0, v18.1.0, v18.1.1, v18.1.2, v18.1.3, v18.2.0, v18.2.1, v18.2.2, v18.2.3, v18.2.4, v18.2.5, v18.2.6, v18.2.7, v18.2.8, v19.1.0, v19.1.1, v19.2.0, v19.2.1, v19.2.2, v19.2.3, v19.2.4, v19.2.5, v19.2.6, v19.2.7, v20.0.0, v20.2.0, v20.2.1, v20.2.2, v20.2.3, v20.2.4)

YS Updated by yulong shi about 2 months ago Actions #2

Fix proposed in https://github.com/ceph/ceph/pull/72555 (revert of #61933 + no_reply() on the fsid-mismatch path in prepare_log()).

Verification on the test cluster (3 mons, leader mon.node-1; all OSDs and the mgr connected to peons)

1. Normal path: log acks are delivered again

#61933 build #72555 build
acks received by OSDs connected to a peon none every batch
osd.1 log_queue growing (10 -> 18 ...) backlog of 20 trimmed by the first ack, then stays at 2
mgr log_queue 1747+ and growing backlog of 2484 trimmed by the first ack, then 1
forwarded MLogs / acks dropped on peons 28 / 28 18 / 0
early no_reply() on the leader for new MLogs every MLog 0

2. Zero-fsid path: reproduced and released

Reproduced by briefly blocking only osd.1's mon connections at startup, so that the tick queues "purged_snaps scrub" entries before the OSD has the real monmap (the same entries osd.6 queued in the original incident). Reproduced 3 out of 3 times:

14:08:00.839 osd.1   monclient: build_initial_monmap          (mons named noname-a/b/c -> "cct?" branch, fsid 0)
14:08:02.847 osd.1   monclient(hunting): picked mon.noname-*   (mon connections blocked)
14:08:03.838 osd.1   purged_snaps scrub starts / ok            (queued before the real monmap)
14:08:12.857 mon.node-2@1(peon)   forward_request 1925 request log(11 entries from seq 2 at 2026-10-10T14:08:03.839715+0800)
14:08:12.858 mon.node-1@0(leader).log handle_log on fsid 00000000-0000-0000-0000-000000000000 != 38c2f003-4a7b-45e1-91f2-4c7e1389e407
14:08:12.858 mon.node-1@0(leader) no_reply to osd.1 v2:192.168.2.232:6802/28296 via v2:192.168.2.232:3300/0 for request log(11 entries from seq 2 ...)
14:08:12.858 mon.node-2@1(peon)   handle_route tid 1925 null

The routed request is released immediately. 40 s later: HEALTH_OK, and no op older than 30 s on any mon. Without the fix, the same sequence leaves a permanent slow op on the peon (the original incident).

KC Updated by Kefu Chai about 2 months ago Actions #3

  • Status changed from New to Fix Under Review
  • Backport changed from tentacle, squid, reef to umbrella, tentacle, squid, reef

LF Updated by Laura Flores about 2 months ago Actions #4

PR added to a batch.

KS Updated by Kamoltat (Junior) Sirivadhna about 2 months ago Actions #5

PR sent to QA for testing

NM Updated by Nitzan Mordechai about 2 months ago Actions #6

  • Related to Bug #81511: mon/LogMonitor: since v19.2.3, MLogAck for MLog forwarded by a peon is dropped; client log queues grow forever and are resent in full on every mon reconnect added

RZ Updated by Radoslaw Zarzynski about 2 months ago Actions #7

  • Priority changed from Normal to High

RZ Updated by Radoslaw Zarzynski about 1 month ago Actions #8

  • Related to deleted (Bug #81511: mon/LogMonitor: since v19.2.3, MLogAck for MLog forwarded by a peon is dropped; client log queues grow forever and are resent in full on every mon reconnect)

LF Updated by Laura Flores about 1 month ago Actions #9

Kamoltat (Junior) Sirivadhna wrote in #note-5:

PR sent to QA for testing

Same

RZ Updated by Radoslaw Zarzynski about 1 month ago Actions #10

  • Has duplicate Bug #81511: mon/LogMonitor: since v19.2.3, MLogAck for MLog forwarded by a peon is dropped; client log queues grow forever and are resent in full on every mon reconnect added

KS Updated by Kamoltat (Junior) Sirivadhna about 1 month ago Actions #11

QA batch was re-run so still waiting for QA review

KS Updated by Kamoltat (Junior) Sirivadhna about 1 month ago Actions #12

  • Backport changed from umbrella, tentacle, squid, reef to umbrella, tentacle, squid

RZ Updated by Radoslaw Zarzynski about 1 month ago Actions #13

Approved the fix.

KS Updated by Kamoltat (Junior) Sirivadhna 29 days ago Actions #14

  • Status changed from Fix Under Review to Pending Backport

RADOS APPROVED and merging -> pending_backport

UB Updated by Upkeep Bot 29 days ago Actions #15

  • Copied to Backport #82683: tentacle: mon: zero-fsid MLog leaks a routed request; #61933 workaround drops all log acks for peon clients added

UB Updated by Upkeep Bot 29 days ago Actions #16

  • Copied to Backport #82684: squid: mon: zero-fsid MLog leaks a routed request; #61933 workaround drops all log acks for peon clients added

UB Updated by Upkeep Bot 29 days ago Actions #17

  • Copied to Backport #82685: umbrella: mon: zero-fsid MLog leaks a routed request; #61933 workaround drops all log acks for peon clients added

UB Updated by Upkeep Bot 29 days ago Actions #18

  • Status changed from Pending Backport to Backporting
  • Merge Commit set to 7d8e945aa3687a494c095d4bbe7978d6cc671383
  • Fixed In set to v22.0.0-437-g7d8e945aa3
  • Upkeep Timestamp set to 2026-11-04T20:50:33+00:00

UB Updated by Upkeep Bot 29 days ago Actions #19

  • Upkeep Timestamp changed from 2026-11-04T20:50:33+00:00 to 2026-11-04T20:50:46+00:00

KS Updated by Konstantin Shalygin 21 days ago Actions #20

  • Target version set to v22.0.0
  • Source set to Community (user)
Actions

Also available in: PDF Atom