]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: set_healthy_stretch_mode in update_from_paxos, not random leader calls! 41130/head
authorGreg Farnum <gfarnum@redhat.com>
Tue, 13 Apr 2021 06:25:47 +0000 (06:25 +0000)
committerGreg Farnum <gfarnum@redhat.com>
Mon, 3 May 2021 22:58:44 +0000 (22:58 +0000)
Add header comment describing how this works now.

Fixes: https://tracker.ceph.com/issues/50308
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
(cherry picked from commit adbaeeec959f6341540ba96cbad9e0c46c53a50f)

Fixes: https://tracker.ceph.com/issues/50344
Signed-off-by: Greg Farnum <gfarnum@redhat.com>
src/mon/Monitor.cc
src/mon/Monitor.h
src/mon/OSDMonitor.cc

index 99b33801e5edf26d1d20cc2ce5b0204cae90e28e..90e54ab5bbd1cd0ecbf4d32913c6ebf29c8d7252 100644 (file)
@@ -6677,7 +6677,6 @@ void Monitor::go_recovery_stretch_mode()
   if (!osdmon()->is_writeable()) {
     osdmon()->wait_for_writeable_ctx(new CMonGoRecovery(this));
   }
-  set_recovery_stretch_mode();
   osdmon()->trigger_recovery_stretch_mode();
 }
 
@@ -6771,7 +6770,6 @@ void Monitor::trigger_healthy_stretch_mode()
   }
 
   ceph_assert(osdmon()->osdmap.recovering_stretch_mode);
-  set_healthy_stretch_mode();
   osdmon()->trigger_healthy_stretch_mode();
   monmon()->trigger_healthy_stretch_mode();
 }
index 5a215545cbdc4d5a6e04ae402abc2bda365a2612..ccdd5fe65d5718bb37bbfe16acc0e4ae188caa2c 100644 (file)
@@ -266,6 +266,19 @@ public:
   bool is_stretch_mode() { return stretch_mode_engaged; }
   bool is_degraded_stretch_mode() { return degraded_stretch_mode; }
   bool is_recovering_stretch_mode() { return recovering_stretch_mode; }
+
+  /**
+   * This set of functions maintains the in-memory stretch state
+   * and sets up transitions of the map states by calling in to
+   * MonmapMonitor and OSDMonitor.
+   *
+   * The [maybe_]go_* functions are called on the leader to
+   * decide if transitions should happen; the trigger_* functions
+   * set up the map transitions; and the set_* functions actually
+   * change the memory state -- but these are only called
+   * via OSDMonitor::update_from_paxos, to guarantee consistent
+   * updates across the entire cluster.
+   */
   void try_engage_stretch_mode();
   void maybe_go_degraded_stretch_mode();
   void trigger_degraded_stretch_mode(const set<string>& dead_mons,
index e4f13b0538c3a7d923a5c2f5c50732770b1d099c..d2671e9f077f777c7ec79d19596a86795b98a3c9 100644 (file)
@@ -962,6 +962,8 @@ void OSDMonitor::update_from_paxos(bool *need_bootstrap)
       } else {
        mon.set_recovery_stretch_mode();
       }
+    } else {
+      mon.set_healthy_stretch_mode();
     }
     if (marked_osd_down &&
        (!osdmap.degraded_stretch_mode || osdmap.recovering_stretch_mode)) {