From: Sage Weil Date: Fri, 17 Sep 2021 17:51:08 +0000 (-0500) Subject: mon/OSDMonitor: make weight set create safer X-Git-Tag: v17.1.0~849^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F43213%2Fhead;p=ceph.git mon/OSDMonitor: make weight set create safer We cannot return early success based on uncommitted state. Signed-off-by: Sage Weil --- 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;