XTDB nodes can save checkpoints of their query indices on a regular basis, so that new nodes can start to service queries faster.
XTDB nodes that join a cluster have to obtain a local set of query indices before they can service queries.
These can be built by replaying the transaction log from the beginning, although this may be slow for clusters with a lot of history.
Checkpointing allows the nodes in a cluster to share checkpoints into a central 'checkpoint store', so that nodes joining a cluster can retrieve a recent checkpoint of the query indices, rather than replaying the whole history.
The checkpoint store is a pluggable module - there are a number of officially supported implementations:
XTDB nodes in a cluster don’t explicitly communicate regarding which one is responsible for creating a checkpoint - instead, they check at random intervals to see whether any other node has recently created a checkpoint, and create one if necessary.
The desired frequency of checkpoints can be set using approx-frequency
.
The default lifecycle of checkpoints is unbounded - XTDB will not attempt to clean up old checkpoints unless explicitly told to. See setting up a retention policy below for how to manage checkpoint lifecycles within the XTDB checkpointer module itself.
|
Current behaviour of the checkpointer is such that we only make a checkpoint if we have processed new transactions since the previous checkpoint. As such - you will need to be careful if you have any external lifecycle policies set on your checkpoints - if no new transactions are handled for a period, no new checkpoints will be made, and you may risk having no checkpoints and having to replay from the Transaction Log!
|