...
- Initial state:
- Ignite nodes started from snapshot, or other consistent state (after graceful cluster stop / deactivation).
- Ignite node inites a global snapshot, by starting DistributedProcess (by discovery IO).
- Every (incl. client and non-baseline) node starts a local snapshot process after receiving a message from DistributedProcess.
- Phase 1:
- Write WAL record - commit LocalState.
- fix
snpVersion
= GridCacheVersion#next(topVer)
- Collect all active transactions originated by near node, which nearXidVersion is less than
snpVersion
- Note, continue collecting transactions that are less than
snpVersion
, and for which local node is near (to exclude them later) - after finishing all collected transactions: notify Ignite nodes with
snpVersion
(with DistributedProcess protocol).
- After all nodes finished first phase, they received Map<UUID, GridCacheVersion> from other nodes.
- Phase 2: Only server baseline nodes continue work there:
- Collect all active transactions, find their near node (by GridCacheVersion#nodeOrderId), filter them with known GridCacheVersion
- Await all such transaction completed.
- Write WAL record with the received map.
- Phase 3:
- Stop collecting near transactions that are less than local
snpVersion
and send them to other nodes. - On receiving such map, write a new WAL record again, that contains additional skip collection.
- After finishing Phase 3, process of snapshot is finished.
...
- Increments of GridCacheVersions is CAS operations from different threads. But the version is assigned to a transaction in non-atomic way. No guarantee that
snpVersion
is greater than version of transaction created after fixing snpVersion. Ignite should track such transactions:- With fair locking while creating and assigning version to transaction - possible performance degradation.
- With additional filter after preparing a snapshot (4.d) - now there are 3 steps for preparing snapshot.
- For case OPTIMISTIC + PRIMARY_SYNC we can miss backup transaction - looks like need additional sync process? TBD
- Client and non-baseline nodes has a job to do: collecting of transactions, awaiting them finished, sending a response. It could be non-reliable, as client nodes can be short-lived:
- Also should handle special cases when transaction is committed after client node gone and there is no info about it actual version.
- No safe previous record to restore, if some incremental snapshots created. Need to filter all history.
...
{"serverDuration": 187, "requestCorrelationId": "f417e418dcacf5b4"}