]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/OSDMonitor: make weight set create safer
authorSage Weil <sage@newdream.net>
Fri, 17 Sep 2021 17:51:08 +0000 (12:51 -0500)
committerSage Weil <sage@newdream.net>
Fri, 17 Sep 2021 18:08:31 +0000 (13:08 -0500)
We cannot return early success based on uncommitted state.

Signed-off-by: Sage Weil <sage@newdream.net>
src/mon/OSDMonitor.cc

index 88f95fe40a853643ed38b94fad3734e213b0f51d..3c1021230602f55865c44104afac3a3a8d64ed04 100644 (file)
@@ -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;