Services
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 services.md, and llms.txt lists every page.Part of Orleans.Lattice.Backup API reference.
ILatticeBackupCaptureService
The full-capture engine.
Task<LatticeBackupCaptureResult> CaptureAsync(LatticeBackupCaptureRequest request, CancellationToken cancellationToken = default)- captures a full backup of the request's scope and returns its content-addressed id and manifest. ThrowsArgumentNullException(requestnull),LatticeAuthorizationDeniedException(unauthorized),LatticeSnapshotReplayBudgetExceededException(scope exceeds the replay budget),LatticeSaturatedException(snapshot open shed under saturation), andLatticeCursorSnapshotExpiredException(pinned snapshot expired mid-capture). With a tenancy add-on active it also throwsLatticeBackupTenantIsolationException(the tree is outside the caller's tenant) andLatticeTenantAccessDeniedException(the capture is not admitted under the calling tenant's request-rate budget).Task<LatticeBackupSetCaptureResult> CaptureSetAsync(LatticeBackupSetCaptureRequest request, CancellationToken cancellationToken = default)- captures a backup set: one full backup per scope grouped under a single set manifest. WhenCrossTreeConsistentis set and the set spans more than one tree, every tree is captured inside a single causal fence, selected after in-flight cross-tree atomic sagas drain, so a cross-tree atomic write is never torn across the set (each tree is still captured by its own snapshot, one after another). When the set spans more than one tree, every member manifest is stamped with the set'sSetId, name, and capture time (SetCreatedAtUtc) so the catalogued per-tree backups can be grouped back into one logical set entry, and the returnedBackupSetManifest.SetIdis that same id. A set of a single scope is deliberately left unstamped - it is indistinguishable from a plain backup and lists as one - so its returnedSetIdisnull: the create response agrees with the catalog row, and there is no id that resolves to nothing. Restore such a backup withRestoreAsync(backupId), notRestoreSetAsync. Throws the same exceptions asCaptureAsync, plusLatticeBackupCrossTreeFenceExceptionwhen a stable fence cannot be established within the configured attempts or drain timeout.
ILatticeBackupIncrementalCaptureService
The incremental-capture engine.
Task<LatticeBackupCaptureResult> CaptureIncrementalAsync(LatticeBackupIncrementalCaptureRequest request, CancellationToken cancellationToken = default)- captures an incremental backup layered on a base backup and records the base id as the manifest'sBaseBackupId. The base manifest is read from the sink, and the increment inherits the base's scope (the request scope is advisory). When a sound delta cannot be produced - the base resume point was trimmed off the WAL, a range delete surfaced in the delta window, the base chain was captured on a different cluster, the base predates the recording of the atomic batches it held back as undecided, a committed atomic write's prepared writes precede the delta window, the saga decision gate was not held for the whole drain, or a retention pass began pruning the base while the delta drained (the increment's manifest is then withdrawn rather than published with no base) - it falls back to a fresh full capture and returns that result instead. ThrowsArgumentNullExceptionwhenrequestis null,KeyNotFoundExceptionwhen the sink holds no manifest forBaseBackupId, andLatticeAuthorizationDeniedExceptionwhen the caller is not authorized over the base's scope, plus the tenancy exceptionsCaptureAsyncdocuments. A fallback full capture can also throw the replay-budget, saturation, and snapshot-expiry exceptionsCaptureAsyncdocuments.
ILatticeBackupRestoreService
The causally-faithful restore engine.
Task<LatticeRestoreResult> RestoreAsync(LatticeRestoreRequest request, CancellationToken cancellationToken = default)- resolves the backup's manifest (catalog first, then the sink) and authorizes the restore; only then, when the target tree is replicated, is the request handed to the coordinated restore path throughIRestoreSagaDispatcher, whose result it returns. Otherwise it walks the base chain, validates every artifact against its recorded digest, then applies the entries perLatticeRestoreRequest.Mode(in-place bulk-load / merge, or atomic shadow-cutover). Idempotent under retry. Authorization covers both trees the restore names:Restoreover the target tree, and - only whenTargetTreeIdretargets the backup onto a different tree than the one captured -Backupover the source tree recorded in each chain manifest's own scope, at the range actually replayed. A same-tree restore is unaffected. ThrowsArgumentNullException(requestnull),ArgumentException(the target is a reservedsys-backup-*tree),LatticeRestoreValidationException(pre-apply validation failure, including a backup absent from both the catalog and the sink, a broken chain, or a requested sub-scope outside the captured scope; for a replicated target, also a coordinated restore that was refused before it started or aborted), andLatticeAuthorizationDeniedException(unauthorized). With a tenancy add-on active it also throwsLatticeBackupTenantIsolationExceptionwhen the target tree, or a retargeted source tree, is outside the caller's tenant. AShadowCutoverrestore also throwsInvalidOperationExceptionwhen the target tree is deleted, a delete of it is pending, or another alias change of it (a resize, a schema remediation, or a different restore or revert) holds its alias reservation, andLatticeTreeOwnershipDeniedExceptionwhen the registered tree ownership guard refuses its alias swap; see Architecture.Task<IReadOnlyList<LatticeRestoreResult>> RestoreSetAsync(string setId, CancellationToken cancellationToken = default)- expands a captured backup set into its member trees (a set a backup-set schedule captured resolves to the membership the schedule recorded; any other set by scanning the catalog for the manifests stamped withsetId), authorizesRestoreover every member tree before anything is dispatched, and restores each one via shadow-cutover, promoting to a single all-or-nothing coordinated saga when any member is replicated. A set naming one tree the caller may not restore is therefore refused whole withLatticeAuthorizationDeniedException(or, with a tenancy add-on active,LatticeBackupTenantIsolationException). ThrowsArgumentExceptionwhensetIdis null or empty, or when it resolves to no member trees. That last failure distinguishes its two causes: an id that equals the set id a single catalogued backup would have been given (the content address of that one member id) names a single-tree set, which is captured as a plain backup and is never stamped as a set member, so the message names the exactbackupIdto pass toRestoreAsyncinstead; any other unresolved id is reported as absent from the catalog. A local per-member restore can also fail with the exceptionsRestoreAsyncdocuments for aShadowCutoverrestore.Task RevertRestoreAsync(LatticeRestoreResult restore, CancellationToken cancellationToken = default)- reverts aShadowCutoverrestore by swapping the target tree's registry alias back toPreviousPhysicalTreeId. Idempotent. Authorization gates the logical target tree, so the physical tree ids onrestoreare separately re-validated against registry provenance: each must be the target itself, a shadow the engine built for that target, the target's current physical tree, or the pre-restore copy the target's current, not-yet-final restore recorded at its cutover. ThrowsArgumentNullException(restorenull),ArgumentException(not a shadow-cutover result),LatticeRestoreValidationException(a named physical tree does not belong to the target), andLatticeAuthorizationDeniedException(unauthorized). Also throwsInvalidOperationExceptionwhen an unrelated later physical copy superseded this restore (before taking its reservation or changing lineage), when the restore is final (a later restore of the tree committed, it was released, orLatticeBackupOptions.RestoreRevertRetentionelapsed) or the copy it returns to has been retired, while the tree is deleted, a delete of it is pending, or another alias change holds its alias reservation, andLatticeTreeOwnershipDeniedExceptionwhen the registered tree ownership guard refuses re-pointing the alias.Task ReleaseRestoreAsync(LatticeRestoreResult restore, CancellationToken cancellationToken = default)- makes aShadowCutoverrestore final:RevertRestoreAsyncrefuses it from then on, and the copy it would have reverted to is retired in the background and purged afterLatticeOptions.SoftDeleteDuration. Idempotent. AuthorizesRestoreover the target tree and re-validates the result's physical tree ids against registry provenance, as a revert does. ThrowsArgumentNullException(restorenull),ArgumentException(not a shadow-cutover result),LatticeRestoreValidationException(a named physical tree does not belong to the target),LatticeAuthorizationDeniedException(unauthorized), andInvalidOperationException(the tree is deleted, or another alias change holds its alias reservation). See Retiring restore copies.Task ReleaseRestoreSetAsync(IReadOnlyList<LatticeRestoreResult> restores, CancellationToken cancellationToken = default)- releases every member result of a set restore, authorizing every member before any is released. Throws asReleaseRestoreAsyncdoes, andArgumentNullExceptionwhenrestoresis null.Task<LatticeRestoreCopyAudit> AuditRestoreCopiesAsync(string treeId, CancellationToken cancellationToken = default)- reports the copies the tree's shadow-cutover restores left behind: its alias target, the copy a revertible restore returns to, every copy no revert can reach, and any hold that keeps them. A read that changes nothing. AuthorizesRestoreover the tree. ThrowsArgumentException(treeIdnull, empty, or a reservedsys-backup-*tree) andLatticeAuthorizationDeniedException(unauthorized).Task<LatticeRestoreCopyAudit> RepairRestoreCopiesAsync(string treeId, CancellationToken cancellationToken = default)- asAuditRestoreCopiesAsync, and schedules the retirement of the copies it reports at once; retirement runs in the background, one copy per pass. Throws asAuditRestoreCopiesAsyncdoes.- The four members above are default interface methods that throw
NotSupportedException, so an existing implementation of the interface still compiles; the registered service implements them.
ILatticeBackupScheduler
The public entry point for on-demand triggers, schedule registration, and retention. Each operation targets a BackupScopeSelector and is coordinated per scope so triggers, scheduled captures, and retention for the same scope never overlap.
Task<string?> TriggerFullBackupAsync(BackupScopeSelector scope)- triggers a full backup; returns the backup id, ornullwhen a capture for the scope is already in flight.Task<string?> TriggerIncrementalBackupAsync(BackupScopeSelector scope)- triggers an incremental backup layered on the most recent backup for the scope (or a full baseline when none exists); returns the backup id, ornullwhen skipped by the overlap guard.Task ScheduleRecurringBackupAsync(LatticeBackupScheduleRequest request)- registers or updates a recurring backup of the request's scope that fires everyInterval, capturing a full or incremental backup per the request. The interval is clamped up to the reminder minimum; a runtime schedule registered this way overrides the configuredLatticeBackupScheduleOptionscadence for the chosen kind. Idempotent. Authorizes the caller'sBackupcapability over the scope at registration (the reminder-fired cycle later runs system-origin, because a reminder carries no caller). ThrowsArgumentNullExceptionwhenrequestis null andLatticeAuthorizationDeniedExceptionwhen the caller is not authorized.Task CancelScheduleAsync(BackupScopeSelector scope, bool incremental)- removes the scope's recurring schedule for one kind (incrementalselects the incremental schedule, otherwise the full one): unregisters that kind's schedule reminder and clears any runtime interval override. Idempotent: a missing schedule is a no-op.Task EnsureScheduleAsync(BackupScopeSelector scope)- registers or updates the recurring full and incremental schedule reminders for the scope per itsLatticeBackupScheduleOptions: an enabled kind is (re-)registered at its configured cadence and a disabled kind's reminder is unregistered. It consults only the configured options, so running it afterScheduleRecurringBackupAsyncreplaces (or, for a kind disabled in options, removes) that kind's runtime schedule reminder; the runtime interval that call recorded is left in place, soBackupSchedulerRuntimeStatuskeeps reporting it untilCancelScheduleAsyncclears it. Idempotent. Authorizes the caller'sBackupcapability over the scope and throwsLatticeAuthorizationDeniedExceptionwhen it is not granted.Task<BackupRetentionReport> PruneAsync(BackupScopeSelector scope)- prunes the scope's backup chain per its retention policy, preserving the base chain of every retained increment; a no-op that retains everything when retention is disabled.
All five scope-typed methods throw ArgumentNullException when scope is null. Triggers, registration, cancellation and pruning require the caller's Backup capability over the scope at the scheduler grain, before any durable mutation or catalog read. Pruning is authorized even when retention is disabled. A missing schedule remains a no-op. Reminder-fired captures and retention retain their runtime-owned system origin.
ILatticeBackupCatalogStore
The durable, introspectable index of manifests, persisted into the reserved sys-backup-catalog tree keyed by backup id.
Task RegisterAsync(BackupManifest manifest, CancellationToken cancellationToken = default)- registers or replaces a manifest, keyed bymanifest.Id. Re-registering an id that is already catalogued carries the existing row'sCreatedAtUtcforward (a backup id is a content address, so the capture time is immutable) and records the later of the two registrations' ranking times asLastCapturedAtUtc; every other field, set membership included, takes the incoming manifest's value. Idempotent. ThrowsArgumentNullExceptionwhenmanifestis null.Task<BackupManifest?> GetAsync(string backupId, CancellationToken cancellationToken = default)- reads a manifest, ornull. ThrowsArgumentExceptionwhenbackupIdis null or empty.Task<bool> RemoveAsync(string backupId, CancellationToken cancellationToken = default)- removes a manifest; returnstruewhen one was removed. ThrowsArgumentExceptionwhenbackupIdis null or empty.IAsyncEnumerable<BackupManifest> ListAsync(CancellationToken cancellationToken = default)- enumerates every catalogued manifest in backup-id order.
ILatticeBackupSink
The pluggable storage sink a backup is written to and restored from. Stores streamed artifacts and self-describing manifests; the artifact surface moves the payload as an ordered chunk sequence so a large tree streams without being materialized whole. Re-writing the same artifact id with the same content is idempotent. The capture engine names each artifact with a per-capture id (scope tree id, scope kind, capture ticks, and a GUID) and records the artifact's SHA-256 digest (BackupContentHash) in the manifest's content descriptor; the content-addressed id is the backup (manifest) id, not the artifact id.
Capability members:
bool IsDurable- whether the sink stores payload outside the cluster it protects (an external, durable store such as Azure Blob or the filesystem sample sink), as opposed to the ephemeral in-cluster sink whose payload shares the fate of the cluster. Disaster-recovery features that only make sense against an off-cluster store - notably the periodic backup-health monitor - gate themselves on this flag:falsekeeps the monitor inert and hides the Explorer health column.
Artifact members:
Task WriteArtifactAsync(string artifactId, IAsyncEnumerable<ReadOnlyMemory<byte>> content, CancellationToken cancellationToken = default)- writes an artifact as an ordered chunk stream. Idempotent for the same id and content. ThrowsArgumentException(artifactIdnull/empty) andArgumentNullException(contentnull).IAsyncEnumerable<ReadOnlyMemory<byte>> ReadArtifactAsync(string artifactId, CancellationToken cancellationToken = default)- reads an artifact back as an ordered chunk stream; yields nothing when absent. ThrowsArgumentExceptionwhenartifactIdis null or empty.Task<bool> DeleteArtifactAsync(string artifactId, CancellationToken cancellationToken = default)- removes an artifact; returnstruewhen one was removed. ThrowsArgumentExceptionwhenartifactIdis null or empty.IAsyncEnumerable<string> ListArtifactIdsAsync(CancellationToken cancellationToken = default)- enumerates every artifact id in id order.
Manifest members:
Task WriteManifestAsync(BackupManifest manifest, CancellationToken cancellationToken = default)- creates or replaces a manifest keyed bymanifest.Id. Idempotent. ThrowsArgumentNullExceptionwhenmanifestis null.Task<BackupManifest?> ReadManifestAsync(string backupId, CancellationToken cancellationToken = default)- reads a manifest, ornull. ThrowsArgumentExceptionwhenbackupIdis null or empty.IAsyncEnumerable<BackupManifest> ListManifestsAsync(CancellationToken cancellationToken = default)- enumerates every manifest in backup-id order.Task<bool> DeleteManifestAsync(string backupId, CancellationToken cancellationToken = default)- removes a manifest; returnstruewhen one was removed. Does not remove referenced artifacts. ThrowsArgumentExceptionwhenbackupIdis null or empty.
Sink-existence probe members (read-only, cheap - existence and committed-metadata only, never downloading or hashing payload):
Task<bool> ManifestExistsAsync(string backupId, CancellationToken cancellationToken = default)- the cheap liveness check used at selection time:truewhen the manifest is present in the sink. ThrowsArgumentExceptionwhenbackupIdis null or empty.Task<BackupSinkResolution> ProbeAsync(string backupId, CancellationToken cancellationToken = default)- the richer resolvability probe used by reconcile / scrub: reports whether the manifest is present and which referenced artifacts are missing (absent, or - for sinks that mark commit - present but not committed). ThrowsArgumentExceptionwhenbackupIdis null or empty.
ILatticeBackupCatalogScrubService
Reconciles the in-cluster catalog against the durable sink in the opposite direction to the rebuild service: it finds catalog rows the sink can no longer resolve (orphans) rather than sink manifests the catalog is missing.
Task<BackupCatalogScrubReport> ScrubAsync(bool pruneOrphans = false, CancellationToken cancellationToken = default)- enumerates every catalog row and probes the sink (ILatticeBackupSink.ProbeAsync) for its resolvability, collecting the orphans - rows whose sink payload (manifest, or a referenced artifact) is gone. Non-destructive by default: it only flags orphans. WhenpruneOrphansistrueit removes each orphan catalog row under system origin, which is idempotent on re-run (a pruned orphan is no longer scanned). Returns aBackupCatalogScrubReportsummarizing counts scanned, orphaned, and removed, whether pruning ran, and the orphan backup ids.
ILatticeBackupCatalogRebuildService
Rebuilds the in-cluster catalog from the durable sink, treating the sink as the single source of truth and the catalog as a rebuildable, self-healing projection over it.
Task<BackupCatalogRebuildReport> RebuildFromSinkAsync(CancellationToken cancellationToken = default)- scans every manifest the sink holds (viaILatticeBackupSink.ListManifestsAsync) and re-registers each into the catalog under system-origin. Idempotent and safe to re-run: a manifest already catalogued is reconciled in place (keeping its immutable capture timestamp) rather than duplicated, and a catalog missing rows the sink has is repopulated. Returns aBackupCatalogRebuildReportsummarizing counts scanned, freshly added, and reconciled.
ILatticeBackupColdRestoreService
Restores a backup into a fresh cluster from the durable sink alone, with zero dependency on any surviving sys-backup-catalog tree. This is the disaster-recovery entry point: a cluster that lost its grain storage (so its catalog is gone) but still has the external sink can enumerate, resolve, chain-walk, and restore its backups from the sink.
Task<LatticeRestoreResult> ColdRestoreAsync(LatticeRestoreRequest request, CancellationToken cancellationToken = default)- bootstraps the reservedsys-trees if they are absent, resolves the target (tip) manifest from the sink alone (never the catalog), then hands the request to the ordinary restore engine (ILatticeBackupRestoreService.RestoreAsync), which walks theBaseBackupIdchain catalog-first with a sink fallback - so on a cluster that lost its catalog the whole chain resolves from the sink - validates every referenced artifact, read from the sink, against its recorded digest, and replays the chain through the HLC-preserving seams; it then re-projects the catalog from the sink so the recovered cluster is left with a correct catalog. ReusesLatticeRestoreRequest/LatticeRestoreResult. Idempotent. ThrowsLatticeRestoreValidationExceptionwhen the backup is absent from the sink, the base chain is broken, or an artifact is missing or tampered;LatticeAuthorizationDeniedExceptionwhen the caller is not authorized (the delegated restore authorizes exactly asRestoreAsyncdoes); andArgumentNullExceptionwhenrequestis null. The delegated restore can also throw the other exceptionsRestoreAsyncdocuments.
ILatticeBackupHealthService
Verifies that a backup's durable sink payload is present and intact, layering content-hash verification on top of the cheap presence probe. Registered by AddLatticeBackup.
Task<BackupHealthReport> VerifyAsync(string backupId, CancellationToken cancellationToken = default)- resolves the backup's manifest, checks presence and committed-metadata of every referenced artifact (reusingILatticeBackupSink.ProbeAsync), then downloads each present artifact and re-hashes it against its recordedBackupContentDescriptor.ContentHashto catch silent corruption. Returns a fresh point-in-timeBackupHealthReport; does not persist it. ThrowsArgumentExceptionwhenbackupIdis null or empty.
ILatticeBackupHealthStore
Persists per-backup health state - the latest BackupHealthReport and the per-backup BackupHealthConfig - in the reserved sys-backup-health ILattice tree keyed by backup id, so the periodic monitor that writes reports and the UI that reads them share one durable projection (no second external store). Registered by AddLatticeBackup.
Task SetReportAsync(BackupHealthReport report, CancellationToken cancellationToken = default)- persists (or replaces) the latest report for itsBackupId. ThrowsArgumentNullExceptionwhenreportis null.Task<BackupHealthReport?> GetReportAsync(string backupId, CancellationToken cancellationToken = default)- reads the latest report, ornull. ThrowsArgumentExceptionwhenbackupIdis null or empty.IAsyncEnumerable<BackupHealthReport> ListReportsAsync(CancellationToken cancellationToken = default)- enumerates every stored report in backup-id order.Task<bool> RemoveAsync(string backupId, CancellationToken cancellationToken = default)- removes the stored report and configuration for a backup; returnstruewhen anything was removed. ThrowsArgumentExceptionwhenbackupIdis null or empty.Task SetConfigAsync(string backupId, BackupHealthConfig config, CancellationToken cancellationToken = default)- persists (or replaces) the per-backup monitor configuration. ThrowsArgumentException(backupIdnull/empty) andArgumentNullException(confignull).Task<BackupHealthConfig?> GetConfigAsync(string backupId, CancellationToken cancellationToken = default)- reads the per-backup configuration, ornullwhen the backup uses the configured defaults. ThrowsArgumentExceptionwhenbackupIdis null or empty.
The periodic monitor itself is an internal reminder-driven grain (mirroring the backup scheduler): once per sweep it enumerates the catalog and re-verifies each enrolled backup whose configured interval has elapsed, writing the result through ILatticeBackupHealthStore. It is inert unless the registered sink reports IsDurable and LatticeBackupHealthOptions.Enabled is true.