...
Code Block | ||||
---|---|---|---|---|
| ||||
/** */ public class ConsistentCutStartRecord extends WALRecord { /** Marker that inits Consistent Cut ID. */ private final ConsistentCutMarkerUUID markerid; } /** */ public class ConsistentCutFinishRecord extends WALRecord { /** Marker that inits Consistent Cut ID. */ private final ConsistentCutMarkerUUID markerid; /** * Collections of transactions committed BEFORE. */ private final Set<GridCacheVersion> before; /** * Collections of transactions committed AFTER. */ private final Set<GridCacheVersion> after; } |
...
lastFinishedCutId
holds previous ConsistentCutId
, or null.DistributedProcess
with special message holds new ConsistentCutMarker
ConsistentCutId
(goal is to notify every node in a cluster about running incremental snapshot). ConsistentCutMarker
by the ConsistentCutId
by discovery.ConsistentCutMarker
ConsistentCutId
by transaction message (Prepare, Finish)ConsistentCutId
, every node: topVersion
with received in marker. Skip if it is different.ConsistentCut
future ConsistentCut<Boolean>
future. Complete with true
if consistent, otherwise false
. committingTx ,
goal (goal is to track COMMITTING transactions, that aren't part of IgniteTxManager#activeTx
)ConsistentCutMarker
ConsistentCutId
.IgniteTxManager#activeTx.
Set listeners on tx#finishFuture.
ConsistentCutStartRecord
to WAL with the received ConsistentCutMarker
. ConsistentCutId
.committingTxs.
Set listeners on tx#finishFuture.
committingTxs
Collects active transactions - concat of IgniteTxManager#activeTx
and committingTxs
.
DistributedProcess
is alive every node signs output transaction messages:ConsistentCutMarker
ConsistentCutId
(to trigger ConsistentCut
on remote node, if not yet).ConsistentCutMarker
ConsistentCutId
(to trigger...) and transaction ConsistentCutMarker
ConsistentCutId
(to notify nodes which side of cut this transaction belongs to).ConsistentCutMarker
ConsistentCutId
on node that commits first:committingTxs
.tx#finishFuture
with callback. Callback the callback is called when transaction finished:check
that transaction completes in consistent way (tx#state != UNKNOWN,tx.finalizationStatus
!= RECOVERY_FINISH). If it isn't then this cut is inconsistent. Complete ConsistentCut exceptionally.If transaction state is UNKNOWN or status is RECOVERY_FINISH, then complete ConsistentCut as inconsistent.
txCutId
equals to if tx#txMarker
is null or differs from local, then transaction put into before
if tx#txMarker
equals to local, then transaction put into after
after
, otherwise it's put into before
.ConsistentCutFinishRecord
into WAL with the collections ( before
, after
). committingTxs
and clean this collection.ConsistentCut
future , and as consistent.DistributedProcess
protocol).ConsistentCut
:lastFinishedCutId
with the current.
ConsistentCut
future becomes null.Ignite ...
Every ignite nodes tracks current ConsistentCutMarker
:
Code Block | ||||
---|---|---|---|---|
| ||||
class ConsistentCutMarker {
UUID id;
AffinityTopologyVersion topVer;
} |
id
is just a unique ConsistentCut
ID (is assigned on the node initiator).topVer
is topology version on node initiator before Incremental Snapshot starts.
On the picture below on left side is a diagram of sending transaction messages. Before sending message it checks whether cut is running with cutMarker()
. If it is then wrap message, otherwise send ordinary message (PrepareRequest
in example).
...