Module changelog

Module changelog 

Source
Expand description

Change lifecycle tracking and durable write-ahead log.

When a storage mutation spans both the high-volume (HV) and long-term (LT) backends, several non-atomic steps must happen in sequence: uploading to LT, committing a tombstone in HV via compare-and-swap, and cleaning up unreferenced blobs. A crash at any point can leave orphaned LT blobs.

This module provides two layers of protection:

  1. In-process trackingChangeGuard is an RAII guard that tracks the current ChangePhase of an operation. When dropped, it spawns a background task to clean up whichever blob is unreferenced based on the phase reached before the drop. This handles normal errors and early returns within a running process.

  2. Durable write-ahead log — The ChangeLog trait records a Change to durable storage before any LT side effects begin. If the process crashes, a recovery scan reads outstanding entries and cleans up orphaned blobs. Recovery is garbage collection — it never replays CAS mutations or finishes incomplete operations.

Structs§

Change
Describes the LT blobs involved in a multi-step storage change.
ChangeGuard
RAII guard that tracks cleanup state for a multi-step storage change.
ChangeId
Unique identifier for a change log entry.
ChangeManager
Manager for multi-step storage changes, including backends and durable log.
InMemoryChangeLog
In-memory ChangeLog for tests and deployments without durable logging.
NoopChangeLog
ChangeLog implementation that discards all entries.

Enums§

ChangePhase
Phase of a multi-step storage change.

Traits§

ChangeLog
Durable write-ahead log for multi-step storage changes.