]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix erroneous commit of monmap stretch mode when failing to enable
authorGreg Farnum <gfarnum@redhat.com>
Fri, 23 Oct 2020 16:32:33 +0000 (16:32 +0000)
committerGreg Farnum <gfarnum@redhat.com>
Fri, 6 Nov 2020 06:12:01 +0000 (06:12 +0000)
MonmapMonitor::try_enable_stretch_mode() was accidentally writing into the
pending_map even when commit was false. Whoops!

Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/mon/MonmapMonitor.cc

index 7f47516335557bce5ae7b2ac3a11a1ebf84f643d..f45cbbe8cb4db3a3734a31c6fb6f2f478195f18b 100644 (file)
@@ -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;
 }