resume

package
v0.2.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package resume holds the repo-side reconciliation a checkpointed backup needs before it can continue (issue #42, hardened for prune-coexistence in #56, segment fast path in #55).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	StartPack uint32 // append point for new packs: max existing pack + 1
	// Preload is the suspended session's index inserts replayed from checkpoint
	// segments (fast path). Empty when the index was rebuilt instead.
	Preload []checkpoint.InsertTuple
	// NextSeq continues checkpoint/segment numbering.
	NextSeq uint32
	// Rebuilt reports whether the slow path (full index rebuild) ran.
	Rebuilt bool
}

Result is what a reconciled repository hands the pipeline to resume.

func Reconcile

func Reconcile(ctx context.Context, repoPath string, c *checkpoint.Checkpoint, key *crypto.MasterKey) (Result, error)

Reconcile prepares a repository to resume the given checkpoint.

Fast path (#55): replay the local checkpoint segments — CRC-validated deltas of sidecar bytes + index inserts written at every pack seal. When they exactly cover the checkpoint's durable prefix and match the on-disk sidecar, the session's inserts are handed back as Preload for the pipeline to re-insert (unflushed until success): no index rebuild, no pack rehash. This is also the only resume path for managed-encryption repos (index.Rebuild refuses them).

Slow path: full index rebuild from the packs on disk plus a prefix-presence check (#42/#56 behavior) — used when segments are missing, torn, or stale (e.g. a prune renumbered packs and removed the segments file).

Both paths are pack-number-agnostic: StartPack comes from the real max pack on disk, never the checkpoint's recorded pack number (#56).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL