]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/mon/PaxosService.h
update sources to v12.1.0
[ceph.git] / ceph / src / mon / PaxosService.h
index 5c6b2872b095d481f32a7b0a69ce909faeee6534..ca75915841e591702b41a3d80444f52c78a99fa7 100644 (file)
@@ -53,7 +53,9 @@ class PaxosService {
    */
   bool proposing;
 
- protected:
+  bool need_immediate_propose = false;
+
+protected:
   /**
    * Services implementing us used to depend on the Paxos version, back when
    * each service would have a Paxos instance for itself. However, now we only
@@ -187,7 +189,7 @@ private:
    * @remarks We only create a pending state we our Monitor is the Leader.
    *
    * @pre Paxos is active
-   * @post have_pending is true iif our Monitor is the Leader and Paxos is
+   * @post have_pending is true if our Monitor is the Leader and Paxos is
    *      active
    */
   void _active();
@@ -356,6 +358,15 @@ public:
    */
   virtual bool should_propose(double &delay);
 
+  /**
+   * force an immediate propose.
+   *
+   * This is meant to be called from prepare_update(op).
+   */
+  void force_immediate_propose() {
+    need_immediate_propose = true;
+  }
+
   /**
    * @defgroup PaxosService_h_courtesy Courtesy functions
    *
@@ -774,6 +785,18 @@ public:
     t->put(get_service_name(), key, bl);
   }
 
+  /**
+   * Put integer value @v into the key @p key.
+   *
+   * @param t A transaction to which we will add this put operation
+   * @param key The key to which we will add the value
+   * @param v An integer
+   */
+  void put_value(MonitorDBStore::TransactionRef t,
+                const string& key, version_t v) {
+    t->put(get_service_name(), key, v);
+  }
+
   /**
    * @}
    */