Skip to content

Commit 629ba7b

Browse files
committed
mon, doc: overriding ec profile requires --yes-i-really-mean-it
This is per https://tracker.ceph.com/issues/64333#note-17 describing driving factors of a catastrophic cluster failure. Signed-off-by: Radoslaw Zarzynski <[email protected]>
1 parent 758a0bc commit 629ba7b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

doc/rados/operations/erasure-code-profile.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ Where:
9696
``--force``
9797

9898
:Description: Override an existing profile by the same name, and allow
99-
setting a non-4K-aligned stripe_unit.
99+
setting a non-4K-aligned stripe_unit. Overriding an existing
100+
profile can be dangerous, and thus ``--yes-i-really-mean-it``
101+
must be used as well.
100102

101103
:Type: String
102104
:Required: No.

src/mon/OSDMonitor.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11305,6 +11305,8 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
1130511305
err = 0;
1130611306
goto reply_no_propose;
1130711307
}
11308+
bool force_no_fake = false;
11309+
cmd_getval(cmdmap, "yes_i_really_mean_it", force_no_fake);
1130811310
if (!force) {
1130911311
err = -EPERM;
1131011312
ss << "will not override erasure code profile " << name
@@ -11313,6 +11315,11 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
1131311315
<< " is different from the proposed profile "
1131411316
<< profile_map;
1131511317
goto reply_no_propose;
11318+
} else if (!force_no_fake) {
11319+
err = -EPERM;
11320+
ss << "overriding erasure code profile can be DANGEROUS"
11321+
<< "; add --yes-i-really-mean-it to do it anyway";
11322+
goto reply_no_propose;
1131611323
}
1131711324
}
1131811325

0 commit comments

Comments
 (0)