...
- Initial state:
- Ignite nodes started from snapshot, or other consistent state (after graceful cluster stop / deactivation).
- var
color = WHITE
. - Empty collection committingTxs (Set<GridCacheVersion>) that goal is to track COMMITTING+ transactions, that aren't part of
IgniteTxManager#activeTx
. It's automatically shrinks after transaction committed.
- After some time, Ignite nodes might have non-empty committingTxs.
- Ignite node inites a global snapshot, by starting DistributedProcess (by discovery IO).
- Every nodes starts a local snapshot process after receiving a mark message (whether by discovery, or by communication with transaction message)
- Atomically: set
color = RED
and disable auto-shrink of committingTxs. - write a snapshot record to WAL (commits LocalState).
- Collect of active transactions - concat of
IgniteTxManager#activeTx
and committingTxs
- While receiving Finish messages from other nodes, node fills ChannelState: exclude and (sent - received) collections.
- After all transactions finished, it writes a WAL record with ChannelState.
- New color is sent with transaction Finish messages.
- Committing node add an additional color field for FinishMessage, that shows whether to include transaction to snapshot, or not.
- Other nodes on receiving a marker with new color starts a local snapshot (see steps from point 3).
- Notifies a node-initiator about finishing local procedure (with DistributedProcess protocol).
- For all nodes
color = RED
. Next snapshot iteration will started with changing color to WHITE
.
Use node-local xid (GridCacheVersion) as
...
snapshot version threshold
To avoid using mark message (color field) we can try rely on fixed GridCacheVersion. Algorithm is as follows:
...