]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon, doc: overriding ec profile requires --yes-i-really-mean-it 56434/head
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Tue, 19 Mar 2024 13:43:10 +0000 (13:43 +0000)
committerZac Dover <zac.dover@proton.me>
Sun, 24 Mar 2024 20:58:17 +0000 (06:58 +1000)
This is per https://tracker.ceph.com/issues/64333#note-17 describing
driving factors of a catastrophic cluster failure.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
(cherry picked from commit 629ba7bd349d48cdaa6d094751e7cfce651ba2bc)

doc/rados/operations/erasure-code-profile.rst
src/mon/OSDMonitor.cc

index 947b34c1f0064c99267204e4a51d25d70587fa90..a8f006398fa30cc71edadaac2fb4408796ef23e5 100644 (file)
@@ -96,7 +96,9 @@ Where:
 ``--force``
 
 :Description: Override an existing profile by the same name, and allow
-              setting a non-4K-aligned stripe_unit.
+              setting a non-4K-aligned stripe_unit. Overriding an existing
+              profile can be dangerous, and thus ``--yes-i-really-mean-it``
+              must be used as well.
 
 :Type: String
 :Required: No.
index 917e9c47d45e25e8b5f2426dfa53ccb020a30d01..518ce8c109a59d8bc3cd9cc2bf4cf4240b67372d 100644 (file)
@@ -11302,6 +11302,8 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
          err = 0;
          goto reply_no_propose;
        }
+       bool force_no_fake = false;
+       cmd_getval(cmdmap, "yes_i_really_mean_it", force_no_fake);
        if (!force) {
          err = -EPERM;
          ss << "will not override erasure code profile " << name
@@ -11310,6 +11312,11 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
             << " is different from the proposed profile "
             << profile_map;
          goto reply_no_propose;
+       } else if (!force_no_fake) {
+         err = -EPERM;
+         ss << "overriding erasure code profile can be DANGEROUS"
+            << "; add --yes-i-really-mean-it to do it anyway";
+         goto reply_no_propose;
        }
       }