Skip to main content

Module catchup

Module catchup 

Source

StructsΒ§

CandidateLease πŸ”’
The candidate lease a takeover waits for before it commits.
RegionCatchupTask
TakeoverPrepared πŸ”’
What a takeover, a catchup that carries no entry its source reported, prepares before the worker checks the region.

ConstantsΒ§

HANDOVER_SEQUENCE_GAP πŸ”’
How far a handover raises the committed sequence above the largest sequence this node knows the region used, in the manifest or on this node, so that writes accepted while the recorded tail is replayed outrank its rows. Those rows keep the sequences their source gave them, which this node does not know: the gap allows the source fewer than 2^40 sequences that the manifest does not record.
MAX_HANDOVER_SEQUENCE πŸ”’
The largest committed sequence a handover raises a region to, which allows about 2^22 handovers that record a tail. A handover that would pass it fails, leaving the sequences above it to the region’s writes, which allocate them without checking for overflow.

FunctionsΒ§

hand_over πŸ”’
Hands a region whose manifest is published conditionally over to this node node_id, which becomes its writer, from the source node source_node_id that reported upto as its last entry or, in a takeover (candidate is set), whose WAL listing returned upto, a bound at or above every entry in the listed objects; entries of the source above upto are not recovered. Replays nothing.
handoff_entry_id πŸ”’
Returns the entry id a hand-off of the region has to cover: the largest of upto (the source’s reported entry, or the listed bound in a takeover), its flushed entry id and the bounds of its pending tails.
handover_edit πŸ”’
Returns the edit of a handover to floor.node_id (see hand_over) that commits after manifest, recording a tail whose bound is of kind upto_kind. last_sequence is the largest sequence the region used on this node.
takeover_source πŸ”’
Returns the source of a takeover: a catchup that makes region, whose manifest is published conditionally, writable and names a source but no entry the source reported.