summaryrefslogtreecommitdiff
path: root/ovsdb/trigger.h
diff options
context:
space:
mode:
Diffstat (limited to 'ovsdb/trigger.h')
-rw-r--r--ovsdb/trigger.h41
1 files changed, 25 insertions, 16 deletions
diff --git a/ovsdb/trigger.h b/ovsdb/trigger.h
index 79af7f6be..d060c72e5 100644
--- a/ovsdb/trigger.h
+++ b/ovsdb/trigger.h
@@ -22,26 +22,34 @@ struct ovsdb;
/* Triggers have the following states:
*
- * - Initialized (reply == NULL, progress == NULL): Executing the trigger
- * can keep it in the initialized state, if it has a "wait" condition that
- * isn't met. Executing the trigger can also yield an error, in which
- * case it transitions to "complete". Otherwise, execution yields a
- * transaction, which the database attempts to commit. If the transaction
- * completes immediately and synchronously, then the trigger transitions
- * to the "complete" state. If the transaction requires some time to
- * complete, it transitions to the "committing" state.
+ * - Initialized (reply == NULL, progress == NULL, txn_forward == NULL):
+ * Executing the trigger can keep it in the initialized state, if it has a
+ * "wait" condition that isn't met. Executing the trigger can also yield
+ * an error, in which case it transitions to "complete". Otherwise,
+ * execution yields a transaction, which the database attempts to commit.
+ * If the transaction completes immediately and synchronously, then the
+ * trigger transitions to the "complete" state. If the transaction
+ * requires some time to complete, it transitions to the "committing"
+ * state. If the transaction can not be completed locally due to
+ * read-only restrictions and transaction forwarding is enabled, starts
+ * forwarding and transitions to the "forwarding" state.
*
- * - Committing (reply != NULL, progress != NULL): The transaction is
- * committing. If it succeeds, or if it fails permanently, then the
- * trigger transitions to "complete". If it fails temporarily
- * (e.g. because someone else committed to cluster-based storage before we
- * did), then we transition back to "initialized" to try again.
+ * - Committing (reply != NULL, progress != NULL, txn_forward == NULL):
+ * The transaction is committing. If it succeeds, or if it fails
+ * permanently, then the trigger transitions to "complete". If it fails
+ * temporarily (e.g. because someone else committed to cluster-based
+ * storage before we did), then we transition back to "initialized" to
+ * try again.
*
- * - Complete (reply != NULL, progress == NULL): The transaction is done
- * and either succeeded or failed.
+ * - Forwarding (reply == NULL, progress == NULL, txn_forward != NULL):
+ * Transaction is forwarded. Either it succeeds or it fails, the trigger
+ * transitions to "complete".
+ *
+ * - Complete (reply != NULL, progress == NULL, txn_forward == NULL):
+ * The transaction is done and either succeeded or failed.
*/
struct ovsdb_trigger {
- /* In "initialized" or "committing" state, in db->triggers.
+ /* In "initialized", "committing" or "forwarding" state, in db->triggers.
* In "complete", in session->completions. */
struct ovs_list node;
struct ovsdb_session *session; /* Session that owns this trigger. */
@@ -49,6 +57,7 @@ struct ovsdb_trigger {
struct jsonrpc_msg *request; /* Database request. */
struct jsonrpc_msg *reply; /* Result (null if none yet). */
struct ovsdb_txn_progress *progress;
+ struct ovsdb_txn_forward *txn_forward; /* Tracks transaction forwarding. */
long long int created; /* Time created. */
long long int timeout_msec; /* Max wait duration. */
bool read_only; /* Database is in read only mode. */