Commit scope rules v5.6
Commit scope rules are at the core of the commit scope mechanism. They define what the commit scope enforces.
Commit scope rules are composed of one or more operations that work in combination. Use an AND between rules.
Each operation is made up of two or three parts: the commit scope group, an optional confirmation level, and the kind of commit scope, which can have its own parameters.
A full formal syntax diagram is available in the Commit scopes reference.
A typical commit scope rule, such as ANY 2 (group) GROUP COMMIT
, can be broken down into its components. ANY 2 (group)
is the commit scope group specifying, for the rule, which nodes need to respond and confirm they processed the transaction. In this example, any two nodes from the named group must confirm.
No confirmation level is specified, which means that the default is used. You can think of the rule in full, then, as:
The visible
setting means the nodes can confirm once all the transaction's changes are flushed to disk and visible to other transactions.
The last part of this operation is the commit scope kind, which in this example is GROUP COMMIT
. GROUP COMMIT
is a synchronous two-phase commit that's confirmed when any two nodes in the named group confirm they've flushed the transactions changes and made them visible.
The commit scope group
There are three kinds of commit scope groups: ANY
, ALL
, and MAJORITY
. They're all followed by a list of one or more groups in parentheses. This list of groups combines to make a pool of nodes this operation applies to. This list can be preceded by NOT
, which inverts the pool to be all other groups that aren't in the list. Witness nodes aren't eligible to be included in this pool, as they don't replicate data.
ANY n
is followed by an integer value,n
. It translates to anyn
nodes in the listed groups' nodes.ALL
is followed by the groups and translates to all nodes in the listed groups' nodes.MAJORITY
is followed by the groups and translates to requiring a half, plus one, of the listed groups' nodes to confirm, to give a majority.ANY n NOT
is followed by an integer value,n
. It translates to anyn
nodes that aren't in the listed groups' nodes.ALL NOT
is followed by the groups and translates to all nodes that aren't in the listed groups' nodes.MAJORITY NOT
is followed by the groups and translates to requiring a half, plus one, of the nodes that aren't in the listed groups' nodes to confirm, to give a majority.
The confirmation level
PGD nodes can send confirmations for a transaction at different times. In increasing levels of protection, from the perspective of the confirming node, these are:
received
— A remote PGD node confirms the transaction immediately after receiving it, prior to starting the local application.replicated