From: Patrick Donnelly Date: Tue, 28 Mar 2023 14:06:35 +0000 (-0400) Subject: mon/MonmapMonitor: wait for commit before reply X-Git-Tag: v19.0.0~446^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=99e9e59a485cc8b2ce4fe10fcc10703508105f9a;p=ceph.git mon/MonmapMonitor: wait for commit before reply If the monmap is changed, do not reply to command until committed! Signed-off-by: Patrick Donnelly --- diff --git a/src/mon/MonmapMonitor.cc b/src/mon/MonmapMonitor.cc index d162b8e9414..3d77ab6b3a5 100644 --- a/src/mon/MonmapMonitor.cc +++ b/src/mon/MonmapMonitor.cc @@ -1212,8 +1212,11 @@ bool MonmapMonitor::prepare_command(MonOpRequestRef op) reply: getline(ss, rs); - mon.reply_command(op, err, rs, get_last_committed()); - // we are returning to the user; do not propose. + if (propose) { + wait_for_commit(op, new Monitor::C_Command(mon, op, err, rs, get_last_committed() + 1)); + } else { + mon.reply_command(op, err, rs, get_last_committed()); + } return propose; }