Table of Contents

Class ArchiveOptions

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Continuous WAL archiving (Layer 2, #1418): every sealed WAL segment is copied to the backup store before the checkpoint may reclaim it, so a lost database volume costs at most MaxSegmentAge of commits, and a restore can target any archived LSN or time.

public sealed class ArchiveOptions
Inheritance
ArchiveOptions
Inherited Members

Remarks

The two load-bearing values have no default: MaxSegmentAge is the RPO, and BacklogLimitBytes is the disk the engine may spend holding WAL for an archive that cannot keep up. Past it the engine stops waiting for the archive (the gap is recorded, and a restorable point is requested): archiving never endangers the database (BKP-10).

Constructors

ArchiveOptions()

public ArchiveOptions()

Fields

MaxTimeSampleInterval

The coarsest TimeSampleInterval.

public static readonly TimeSpan MaxTimeSampleInterval

Field Value

TimeSpan

MinMaxSegmentAge

The shortest MaxSegmentAge: each switch seals a segment, so a shorter one only multiplies files.

public static readonly TimeSpan MinMaxSegmentAge

Field Value

TimeSpan

MinTimeSampleInterval

The finest TimeSampleInterval: the archiver samples on the backup scheduler's 1 s tick.

public static readonly TimeSpan MinTimeSampleInterval

Field Value

TimeSpan

Properties

BacklogLimitBytes

Bytes of sealed WAL the engine keeps on disk for the archive alone. Past it the checkpoint reclaims as if archiving were off and the archive records a gap. At least two segments (SegmentSize), so one segment waiting for its copy never trips it.

public required long BacklogLimitBytes { get; init; }

Property Value

long

Remarks

Each sealed segment counts at its declared size (SegmentSize, 64 MiB by default), the disk it occupies. Under a trickle of commits — any within each MaxSegmentAge — every MaxSegmentAge seals one segment however little it holds, so a store outage releases the archive after about (BacklogLimitBytes / segment size) × MaxSegmentAge: at the minimum, two 64 MiB segments with a 5 s age, 10 to 15 seconds; 8 GiB with 30 s, about 64 minutes. An idle database seals no segment and is never released.

CloseTimeout

How long a closing engine spends archiving what its last session wrote (a switch, then every sealed segment) before it lets go. Zero: no final pass, the next open archives what is left.

public TimeSpan CloseTimeout { get; init; }

Property Value

TimeSpan

MaxSegmentAge

How long durable WAL may wait in the active segment before the archiver asks for a switch, so it can be archived: the recovery point objective after losing the database volume. At least MinMaxSegmentAge.

public required TimeSpan MaxSegmentAge { get; init; }

Property Value

TimeSpan

TimeSampleInterval

The resolution of restore-to-time: how often the durable LSN is sampled against the clock. Between 1 s and 60 s.

public TimeSpan TimeSampleInterval { get; init; }

Property Value

TimeSpan

Methods

Validate(WalWriterOptions, string, out string)

Checks the bounds against the WAL's configuration and the store's path.

public bool Validate(WalWriterOptions wal, string storePath, out string error)

Parameters

wal WalWriterOptions

The engine's WAL options (segment size).

storePath string

The backup store the archive is written to.

error string

What is wrong, or null.

Returns

bool

true when the options can be used.