From: Greg Farnum Date: Fri, 23 Oct 2020 16:32:33 +0000 (+0000) Subject: mon: fix erroneous commit of monmap stretch mode when failing to enable X-Git-Tag: v16.1.0~657^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0fe26f0ef7c6ecb93ae3627c6dcaf1f5276f5bd4;p=ceph.git mon: fix erroneous commit of monmap stretch mode when failing to enable MonmapMonitor::try_enable_stretch_mode() was accidentally writing into the pending_map even when commit was false. Whoops! Signed-off-by: Greg Farnum --- diff --git a/src/mon/MonmapMonitor.cc b/src/mon/MonmapMonitor.cc index 7f4751633555..f45cbbe8cb4d 100644 --- a/src/mon/MonmapMonitor.cc +++ b/src/mon/MonmapMonitor.cc @@ -1174,9 +1174,11 @@ void MonmapMonitor::try_enable_stretch_mode(stringstream& ss, bool *okay, ceph_assert(!commit); return; } - pending_map.disallowed_leaders.insert(tiebreaker_mon); - pending_map.tiebreaker_mon = tiebreaker_mon; - pending_map.stretch_mode_enabled = true; + if (commit) { + pending_map.disallowed_leaders.insert(tiebreaker_mon); + pending_map.tiebreaker_mon = tiebreaker_mon; + pending_map.stretch_mode_enabled = true; + } *okay = true; }