From 2485e1f7d9711dc989ed9990bbf90859437caaaf Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 17 Sep 2021 12:51:08 -0500 Subject: [PATCH] mon/OSDMonitor: make weight set create safer We cannot return early success based on uncommitted state. Signed-off-by: Sage Weil --- src/mon/OSDMonitor.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 88f95fe40a853..3c1021230602f 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -10236,6 +10236,10 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, goto update; } else if (prefix == "osd crush weight-set create" || prefix == "osd crush weight-set create-compat") { + if (_have_pending_crush()) { + dout(10) << " first waiting for pending crush changes to commit" << dendl; + goto wait; + } CrushWrapper newcrush = _get_pending_crush(); int64_t pool; int positions; -- 2.39.5