From: Greg Farnum Date: Fri, 1 Oct 2021 18:29:28 +0000 (+0000) Subject: mon: don't let users remove the tiebreaker monitor from the map X-Git-Tag: v17.1.0~738^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4e379cd93e76eea59f0babb1de377d068b2e2385;p=ceph.git mon: don't let users remove the tiebreaker monitor from the map Signed-off-by: Greg Farnum --- diff --git a/src/mon/MonmapMonitor.cc b/src/mon/MonmapMonitor.cc index c3d42f76c5fb..66bce6d0ab77 100644 --- a/src/mon/MonmapMonitor.cc +++ b/src/mon/MonmapMonitor.cc @@ -714,6 +714,12 @@ bool MonmapMonitor::prepare_command(MonOpRequestRef op) goto reply; } + if (pending_map.stretch_mode_enabled && + name == pending_map.tiebreaker_mon) { + err = -EINVAL; + ss << "you cannot remove stretch mode's tiebreaker monitor"; + goto reply; + } /* At the time of writing, there is no risk of races when multiple clients * attempt to use the same name. The reason is simple but may not be * obvious.