Documentation ¶
Overview ¶
Package checkpoint contains a utility for persisting checkpoint (fka resolved) timestamps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Set = wire.NewSet(ProvideCheckpoints)
Set is used by Wire.
Functions ¶
This section is empty.
Types ¶
type Checkpoints ¶
type Checkpoints struct {
// contains filtered or unexported fields
}
Checkpoints is a factory for Group instances, which manage checkpoint timestamps associated with a group of tables.
func ProvideCheckpoints ¶
func ProvideCheckpoints( ctx context.Context, pool *types.StagingPool, meta ident.StagingSchema, ) (*Checkpoints, error)
ProvideCheckpoints is called by Wire.
func (*Checkpoints) ScanForTargetSchemas ¶
ScanForTargetSchemas reports any group names that have unresolved timestamps.
func (*Checkpoints) Start ¶
func (r *Checkpoints) Start( ctx *stopper.Context, group *types.TableGroup, bounds *notify.Var[hlc.Range], ) (*Group, error)
Start a background goroutine to update the provided bounds variable. The returned Group facade allows the bounds to be modified in conjunction with updating the checkpoint timestamp staging table. The returned Group is not memoized.
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group provides durable storage of the checkpoint (FKA resolved) timestamps associated with a types.TableGroup. Timestamps to be processed are recorded with Group.Advance and their completion is recorded via Group.Commit. This Group type will collaborate with other components by driving a notify.Var containing an hlc.Range. This range represents a window of eligible checkpoints that require processing, where the minimum is called "committed" and the maximum is called "proposed".
func (*Group) Advance ¶
Advance extends the proposed checkpoint timestamp associated with the Group. It is an error if the timestamp does not advance beyond its current point, as this will indicate a violation of changefeed invariants. If successful, this method will asynchronously refresh the Group.
func (*Group) Commit ¶
Commit updates the applied-at timestamp associated with the checkpoints in the open range [min,max). This will asynchronously refresh the Group.
func (*Group) Refresh ¶
func (r *Group) Refresh()
Refresh the Group asynchronously. This is intended for testing.
func (*Group) TableGroup ¶
func (r *Group) TableGroup() *types.TableGroup
TableGroup returns the types.TableGroup whose checkpoints are being persisted.