Table of Contents
Paper [1] defines a distributed snapshot algorithm. It uses some definitions, let's describe them in terms of Ignite:
Message
- transaction message (...FinishRequest
for 2PC, ...PrepareResponse
for 1PC)Channel
- TCP communication connection from one node to another, by that the Messages is sent.ChannelState
- for single channel it's a set of Messages that was sent, but not committed yet on receiver.IncrementalSnapshot
- on Ignite node it is represented with 2 WAL records (ConsistentCutStartRecord
commits the WAL state, ConsistentCutFinishRecord
describes the ChannelState
). It guarantees that every node in cluster includes in the snapshot:ConsistentCutStartRecord
and weren't included into ConsistentCutFinishRecord#after()
;ConsistentCutStartRecord
and ConsistentCutFinishRecord and were included into ConsistentCutFinishRecord#before()
.Marker
- mark that piggy backs on the Message, and notifies a node about running snapshot.After I
S start and before finish all PrepareRequest
, FinishRequest
are wrapper by ConsistentCutMarkerMessage
instead of regular Message
. This is done to notify target node via communication channel about running IS
.
Consistent Cut
- Successful attempt of creating IncrementalSnapshot.Inconsistent Cut
- Failed attempt of creating a IncrementalSnapshot, due to inability to correctly describe a ChannelState
.Note, ConsistentCut
can't guarantee that specific transaction that runs concurrently with the algorithm will land before or after cut, it only guarantees that set of the transactions before(or after) the cut will be the same on the each node in cluster.
...
ConsistentCut
future equals to null
.committingTxs
that goal is to track COMMITTING+ transactions, that aren't part of IgniteTxManager#activeTx
.DistributedProcess
with DistributedProcess
with special message holds new ConsistentCutMarker
.ConsistentCutMarker
by discovery.ConsistentCutMarker
by transaction message (Prepare, Finish)ConsistentCut
future, creates committingTxscreates committingTxs
, starts signing outgoing messages with the ConsistentCutMarker
.ConsistentCutStartRecord
to WAL with the received ConsistentCutMarker
.IgniteTxManager#activeTx
and committingTxs
ChannelState
)ConsistentCut
is running 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 (near node for 2PC, backup or primary for 1PC).ConsistentCutMarker
and fills prepares before
, after
collections:before
sideafter
sideConsistentCutFinishRecord
ConsistentCutFinishRecord into WAL with ChannelState
the collections ( before
, after
). committingTxs
.ConsistentCut
future, and notifies a node-initiator about finishing local procedure (with DistributedProcess
protocol).ConsistentCut
, :ConsistentCut
future becomes null....