Orleans.Lattice.Backup API reference
This page documents Orleans.Lattice.Backup 10.5.0, in the documentation for Orleans.Lattice 10.5.0 (release line 10.5), built 2026-12-05. It is also published as markdown, with every table and list, at api.md, and llms.txt lists every page.Every public type and member of Orleans.Lattice.Backup, grouped by role. Types not listed here are internal and are described by behaviour in Architecture.
All serializable types are Orleans-serialized ([GenerateSerializer]) with stable aliases; the constructor parameter validation noted below is enforced at construction.
Contents
- Registration: Static extension methods on
ISiloBuilder. - Services: The full-capture engine.
- Extension seams (replication-aware backup): These backup-package-local seams let the replication package layer replication awareness on top of the backup engine - an atomic multi-tree, multi-cluster restore, and a capture-side check that the sink is actually shared - without...
- Tenancy seam: The seam the backup engine consults to keep every capture and restore inside the active tenant's
t/{tenantId}/{name}namespace and within the tenant's quota. - Operation constants and helpers: Public constants for tracked backup operation kinds.
- Requests and results: Full-capture request.
- Scope: Names a region of a tree to back up.
- Manifests and descriptors: The self-describing record of one backup.
- Reports and status: The self-describing size and topology of a restore, resolved from the target backup's manifest chain before any fence is engaged or shadow tree is built, so a coordinated restore can hard-refuse an infeasible target up front.
- Catalog index: The
ILatticeViewProjectionbehind the backup-catalog index materialised view (created whenLatticeBackupOptions.EnableBackupCatalogIndexViewistrue). - Enums:
Full = 0,Incremental = 1. - Options:
LatticeBackupOptions,LatticeBackupScheduleOptions, andLatticeBackupHealthOptionsare documented in full in Configuration. - Reserved-namespace guard
- Content addressing: A backup id is derived from this digest.
- Metrics:
BackupMetricsandLatticeBackupMetricsexpose the meter, its instruments, tag/phase/reason constants, and the emission helpers. - Exceptions: Thrown by
CaptureSetAsyncwhen a stable cross-tree fence cannot be established within the configured attempts or drain timeout. - Public declaration reference: The following inventory includes directly declared public members and overloads, enum values, and record positional members.
Registration
LatticeBackupServiceCollectionExtensions
Static extension methods on ISiloBuilder.
| Method | Signature | Purpose |
|---|---|---|
AddLatticeBackup |
ISiloBuilder AddLatticeBackup(this ISiloBuilder builder, Action<LatticeBackupOptions>? configure = null) |
Adds the backup storage and engine surface: the default in-cluster sink, the catalog store, the capture / incremental / restore engines, the scheduler, options, and the once-per-silo history bootstrap. Ensures the view infrastructure is present so the catalog tree gets durable per-key history. Must be called after AddLattice(...); throws InvalidOperationException when called first. Idempotent. |
ConfigureLatticeBackup |
ISiloBuilder ConfigureLatticeBackup(this ISiloBuilder builder, Action<LatticeBackupOptions> configure) |
Layers an additional LatticeBackupOptions configuration delegate. |
ConfigureLatticeBackupSchedule |
ISiloBuilder ConfigureLatticeBackupSchedule(this ISiloBuilder builder, Action<LatticeBackupScheduleOptions> configure) |
Configures the global LatticeBackupScheduleOptions applied to every scope. The delegate is registered for every named instance, so it also applies to a scope that has a per-scope delegate; the delegates run in registration order, so register the global defaults first for a per-scope override to win. |
ConfigureLatticeBackupSchedule |
ISiloBuilder ConfigureLatticeBackupSchedule(this ISiloBuilder builder, string scopeKey, Action<LatticeBackupScheduleOptions> configure) |
Configures LatticeBackupScheduleOptions for a specific scope keyed by scopeKey (the value from BackupScopeKey.For). Throws ArgumentException when scopeKey is null or empty. |
ConfigureLatticeBackupHealth |
ISiloBuilder ConfigureLatticeBackupHealth(this ISiloBuilder builder, Action<LatticeBackupHealthOptions> configure) |
Configures the cluster-wide LatticeBackupHealthOptions governing the periodic backup-health monitor: whether it runs and the default re-verification cadence. Health monitoring is auto-enrolled and on by default, so this is only needed to change the cadence or disable the monitor. The monitor stays inert against a non-durable sink regardless of these options. Throws ArgumentNullException when builder or configure is null. |
Tenancy seam
The seam the backup engine consults to keep every capture and restore inside the active tenant's t/{tenantId}/{name} namespace and within the tenant's quota. It follows the same null-default pattern as the data-plane tenant gate: AddLatticeBackup installs an inert internal implementation (IsActive is false, every check a no-op), so a host without a tenancy add-on is unchanged; the tenancy add-on registers the active implementation in its place. The tenant is the ambient active tenant, not a parameter.
ILatticeBackupTenantScope
bool IsActive { get; }-truewhen a tenancy add-on has replaced the null default; every tenant check is gated on it.void AuthorizeCapture(string treeId)- verifies the active tenant may capturetreeId: a platform tree is left to the authorization gate, and a tenant-owned tree may be captured only by its owning tenant (a flow with no active tenant is likewise left to the authorization gate). ThrowsLatticeBackupTenantIsolationExceptionwhen refused.void AuthorizeRestoreTarget(string treeId)- applies the same ownership rule to a restore target, before any record is streamed. ThrowsLatticeBackupTenantIsolationExceptionwhen refused.ValueTask<IBackupRestoreAdmission> BeginRestoreAsync(string targetTreeId, CancellationToken cancellationToken = default)- opens a per-record admission controller for a restore intotargetTreeId, resolving the active tenant's quota once.
IBackupRestoreAdmission
The per-restore admission controller the restore stream consults once per record. A refused record is dead-lettered (skipped), never silently written. Not required to be thread-safe.
long AdmittedCount { get; }- records admitted (written) so far.long DeadLetteredCrossTenant { get; }- records dead-lettered because they were addressed outside the active tenant's namespace.long DeadLetteredOverQuota { get; }- records dead-lettered because admitting them would exceed the active tenant's key quota.BackupRestoreRecordDisposition Admit(string key)- decides whether the record may be written, updating the counters. ThrowsArgumentNullExceptionwhenkeyis null.
BackupRestoreRecordDisposition
| Value | Meaning |
|---|---|
Admit |
Inside the active tenant's namespace and within quota; the record is written. |
CrossTenant |
Addressed outside the active tenant's namespace; the record is dead-lettered. |
OverQuota |
Would take the active tenant past its key quota; the record is dead-lettered. |
An in-process control value only (no serializer surface).
Operation constants and helpers
BackupOperationKinds
Public constants for tracked backup operation kinds. Prefix is backup., and the concrete kinds are Capture (backup.capture), IncrementalCapture (backup.incremental-capture), SetCapture (backup.set-capture), Restore (backup.restore), ColdRestore (backup.cold-restore), HealthCheck (backup.health-check), CatalogRebuild (backup.catalog-rebuild), and CatalogScrub (backup.catalog-scrub).
BackupOperationPhases
Public constants for progress phases reported by tracked operations: Capturing, CapturingMembers, WritingMembers, ResolvingMembers, ApplyingRetention, Cataloguing, Bootstrapping, Validating, Applying, Replaying, Verifying, RebuildingCatalog, ScrubbingCatalog, and PruningOrphans. A kind reports only the phases that apply to the work in hand.
BackupOperationUnits
Public constants for progress unit names: Entries (entries), Shards (shards), Members (members), Manifests (manifests), and Artifacts (artifacts).
BackupOperationResultKeys
Public constants for the string result map carried by a succeeded tracked operation: backupId, setId, memberBackupIds, targetTreeId, mode, restoreOperationId, manifestChain, entriesApplied, shadowPhysicalTreeId, previousPhysicalTreeId, deadLetteredCrossTenant, deadLetteredOverQuota, healthStatus, missingArtifactCount, hashMismatchArtifactCount, scannedCount, registeredCount, reconciledCount, skippedCount, orphanCount, removedCount, pruned, and orphanBackupIds.
BackupOperationResults
Helpers for reading operation result maps. TryReadRestoreResult(IReadOnlyDictionary<string, string> result, out LatticeRestoreResult? restore) reconstructs the full restore result when the map has the restore keys, ReadMemberBackupIds(IReadOnlyDictionary<string, string> result) parses the comma-separated set-member backup ids, TryReadCatalogRebuildReport(IReadOnlyDictionary<string, string> result, out BackupCatalogRebuildReport? report) reconstructs a catalog rebuild report, and TryReadCatalogScrubReport(IReadOnlyDictionary<string, string> result, out BackupCatalogScrubReport? report) reconstructs a catalog scrub report.
Scope
BackupScopeSelector
Names a region of a tree to back up.
- Constructor:
BackupScopeSelector(BackupScopeKind kind, string treeId, string? keyOrPrefix = null). ThrowsArgumentExceptionwhentreeIdis null/empty, aWholeTreescope carries a key/prefix, or aKey/Prefixscope omits its key/prefix. - Properties:
BackupScopeKind Kind,string TreeId,string? KeyOrPrefix. - Factories:
static BackupScopeSelector WholeTree(string treeId),static BackupScopeSelector Prefix(string treeId, string prefix),static BackupScopeSelector Key(string treeId, string key).
BackupScopeKey
static string For(BackupScopeSelector scope)- the deterministic scope key used as the per-scope scheduler grain key and the named-options key. Two selectors covering the same region produce the same key. ThrowsArgumentNullExceptionwhenscopeis null.
Catalog index
BackupCatalogIndexProjection
The ILatticeViewProjection behind the backup-catalog index materialised view (created when LatticeBackupOptions.EnableBackupCatalogIndexView is true). It lowers each catalog registration - a Set carrying a BackupManifest - into one compact BackupCatalogIndexRow, re-keyed so the index scans newest-first with the members of a backup set contiguous; deletes and range deletes project nothing, and the listing drops any index row whose backup no longer exists in the catalog.
const string Version- the projection's code-identity version (backup-catalog-index-v3).string ProjectionVersion { get; }- returnsVersion.IEnumerable<ViewWrite> Project(LatticeMutation mutation)- maps one catalog mutation to its index-row upsert.
BackupCatalogIndexRow
The compact row the index stores per catalogued backup - exactly the fields the listing filters and sorts on - so a filtered, created-descending, paged query is answered from the index and only the rows that land on the page read their full manifest. Serialized, immutable.
string BackupId,string Name,BackupKind Kind,string TreeId,DateTimeOffset CreatedAtUtc- the indexed backup's id, name, kind, scope tree, and capture time.string? SetId,string? SetName- the backup set the backup belongs to, ornullwhen it was captured standalone.string? BaseBackupId- the base an incremental is layered on, ornullfor a full backup.string DisplayName-SetNamewhen the backup belongs to a set, otherwiseName.
Enums
BackupKind
Full = 0, Incremental = 1.
BackupScopeKind
WholeTree = 0, Prefix = 1, Key = 2.
BackupKeyMergeMode
LastWriterWins = 0, Crdt = 1.
LatticeRestoreMode
InPlace = 0 (a bottom-up bulk-load fast path when the target tree has never been registered and a single full whole-tree backup is restored with no narrower sub-scope, otherwise a last-writer-wins merge that converges with whatever the target already holds), ShadowCutover = 1 (build a fresh physical tree and atomically swap the registry alias).
LatticeRestoreCopyHold
Why restore-copy retirement retires nothing of a tree: None, UnknownRevertTarget (the current restore is revertible but was committed before its revert target was recorded), ForeignAliasTarget (the tree resolves to a copy no restore built), and TreeNotRegistered.
BackupScopeRunOutcome
None = 0, Success = 1, Failure = 2, Denied = 3 (the last cycle was refused by the access gate, recorded apart from a generic Failure).
BackupHealthStatus
Unknown = 0 (never verified), Healthy = 1 (manifest and every artifact present, committed, and hash-matched), Warning = 2 (manifest present but at least one artifact missing, uncommitted, or hash-mismatched - or, for a replicated tree, the sink is not readable from a peer cluster), Missing = 3 (manifest itself absent - the catalog row is an orphan).
BackupSinkSharingEnforcement
Disabled = 0 (never probe), Warn = 1 (the default - probe, log loudly, annotate health, but start), FailFast = 2 (a positively refuted sink blocks silo start). See Configuration.
BackupSetMembershipMode
How a backup-set schedule chooses its trees: Explicit = 0 (exactly the scopes the schedule names, one per distinct tree), AllTrees = 1 (every user tree visible in the registering caller's tenant, whole, less any tree under ExcludedTreePrefixes; IncludeNewTrees decides whether the membership is re-resolved at every run or pinned at registration).
BackupSetScheduleTrigger
What started a backup-set schedule run: Schedule = 0 (the schedule's reminder fired), Manual = 1 (a caller asked for a run now).
Options
LatticeBackupOptions, LatticeBackupScheduleOptions, and LatticeBackupHealthOptions are documented in full in Configuration. LatticeBackupHealthOptions configures the periodic health monitor cluster-wide: bool Enabled (default true - health monitoring is auto-enrolled) and TimeSpan DefaultInterval (default six hours), plus the static MinimumInterval (one minute) the sweep reminder clamps up to and the static DefaultSweepInterval (six hours) that DefaultInterval defaults to. The monitor stays inert against a non-durable sink regardless of these options.
Reserved-namespace guard
LatticeBackupReservedTrees
static string Prefix- the reserved tree-name prefix owned by the backup package (sys-backup-).static bool IsReserved(string treeId)-truewhentreeIdcollides with the reserved namespace. ThrowsArgumentNullExceptionwhentreeIdis null.static void ThrowIfReserved(string treeId, string? paramName = null)- throwsArgumentExceptionwhentreeIdis null, empty, or reserved.
Content addressing
BackupContentHash
static string Compute(ReadOnlySpan<byte> content)- the 64-character lowercase hexadecimal SHA-256 of the bytes.static string Compute(IEnumerable<ReadOnlyMemory<byte>> chunks)- the SHA-256 of an ordered chunk sequence, as if concatenated, without buffering the payload whole. ThrowsArgumentNullExceptionwhenchunksis null.
A backup id is derived from this digest. A full backup's id is the digest of its payload. An incremental backup's id is the SHA-256 of the UTF-8 bytes of its base backup id, the unit separator U+001F, and the digest of its payload. A capture that produces identical bytes therefore re-derives the same id and republishes that backup. One exception keeps identical content in two scopes apart (issue #5620): when a full backup's id already belongs to a backup of a different scope, the capture takes its scope-qualified id instead - the SHA-256 of the UTF-8 bytes of scope, U+001F, the capture's scope key (BackupScopeKey.For), U+001F, and the payload digest - and a scope that holds a scope-qualified id keeps re-deriving it. Ids that 10.2.0 derived for content captured in one scope are unchanged.
Metrics
BackupMetrics and LatticeBackupMetrics expose the meter, its instruments, tag/phase/reason constants, and the emission helpers. They are documented in full in Observability.
Exceptions
LatticeBackupCrossTreeFenceException : Exception
Thrown by CaptureSetAsync when a stable cross-tree fence cannot be established within the configured attempts or drain timeout. Constructors: (string message) and (string message, Exception innerException).
LatticeBackupTenantIsolationException : InvalidOperationException
Thrown by ILatticeBackupTenantScope.AuthorizeCapture / AuthorizeRestoreTarget when a capture or restore would cross the active tenant's isolation boundary. The operation is refused before any data is read or written. It also implements the core ILatticeDomainFault marker, which identifies it as a deliberate domain refusal rather than the framework failure its base type suggests. Constructors: (string message) and (string message, Exception innerException).
LatticeRestoreValidationException : InvalidOperationException
Thrown by RestoreAsync when a backup fails pre-apply validation (for example an artifact whose bytes do not match its recorded content digest), and by the other restore entry points - ColdRestoreAsync, RestoreSetAsync's per-member restores, RevertRestoreAsync (a named physical tree that does not belong to the target), and the ILatticeCoordinatedRestoreEngine seams. The replication package's coordinated restore path also throws it when a replicated restore is refused before it starts or aborts. Like the tenant-isolation exception it implements the core ILatticeDomainFault marker. Constructors: (string message) and (string message, Exception innerException).