Table of Contents
ConsistentCut splits timeline WAL on 2 global areas - BEFORE Before
and AFTER After
. It guarantees that every transaction committed BEFORE committed Before
also will be committed BEFORE Before
on every other node participated in the transaction. It means that an Ignite node can safely recover itself to this point the Before
state without any coordination with other nodes.
The border between Before
and After
areas consists of two WAL records - ConsistentCutStartRecord
and ConsistentCutFinishRecord
.
It guarantees that the Before
consists of:
1. transactions committed before ConsistentCutStartRecord
and weren't included into ConsistentCutFinishRecord#after()
;
2. transactions committed between ConsistentCutStartRecord
and ConsistentCutFinishRecord and were included into ConsistentCutFinishRecord#before()
.
Code Block | ||||
---|---|---|---|---|
| ||||
/** */
public class ConsistentCutStartRecord extends WALRecord {
/** Marker that inits Consistent Cut. */
private final ConsistentCutMarker marker;
}
/** */
public class ConsistentCutFinishRecord extends WALRecord {
/**
* Collections of transactions committed BEFORE.
*/
private final Set<GridCacheVersion> before;
/**
* Collections of transactions committed AFTER.
*/
private final Set<GridCacheVersion> after;
}
|
DistributedProcess
with special message holds new ConsistentCutMarker
(goal is to notify every node in a cluster about running incremental snapshot). ConsistentCutMarker
by discovery.ConsistentCutMarker
by transaction message (Prepare, Finish)topVersion
with received in marker. Skip if it is different.ConsistentCut
futurecommittingTx,
goal is to track COMMITTING+ transactions, that aren't part of IgniteTxManager#activeTx
ConsistentCutMarker
.ConsistentCutStartRecord
to WAL with the received ConsistentCutMarker
.IgniteTxManager#activeTx
and committingTxs
.DistributedProcess
is alive every node signs output transaction messages:ConsistentCutMarker
(to trigger ConsistentCut
on remote node, if not yet).ConsistentCutMarker
(to trigger...) and transaction ConsistentCutMarker
(to notify nodes which side of cut this transaction belongs to).ConsistentCutMarker
on node that commits first.ConsistentCutMarker
and prepares before
, after
collections:before
sideafter
sidebefore
, after
). committingTxs
.ConsistentCut
future, and notifies a node-initiator about finishing local procedure (with DistributedProcess
protocol).ConsistentCut
:ConsistentCut
future becomes null....