*/
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
* @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();
*/
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
*
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);
+ }
+
/**
* @}
*/