Documentation
¶
Overview ¶
Package checkpointstore owns the native FileCheckpointV2 records and the ordinary-operation registry that bounds resume, list, and discard work.
The package deliberately exposes only live capability handles to the output runtime. Session headers and terminal receipt/history models never enter this module, so they cannot become accidental prerequisites for recovery.
Index ¶
- Constants
- func FileFor(directory outputcap.Directory, recordID checkpointmodel.RecordID, create bool) (outputcap.Directory, string, error)
- func InstallCreate(directory outputcap.Directory, name string, encoded []byte) error
- func InstallReplace(directory outputcap.Directory, name string, previous, next []byte) error
- func InstallReplaceStrict(directory outputcap.Directory, name string, previous, next []byte) error
- func IsTemporaryName(name string) bool
- func MatchesTemporaryName(candidate, target string, encoded []byte) bool
- func OpenShard(parent outputcap.Directory, shard string, create bool) (outputcap.Directory, error)
- func OperationTemporaryName(operation receivecontract.OperationID, name string, encoded []byte, ...) string
- func ParseRecoveryArtifactLocation(shard string, name string, kind RecoveryArtifactKind) (checkpointmodel.ObjectID, error)
- func ReadFile(directory outputcap.Directory, name string) ([]byte, error)
- func RecoveryArtifactLocation(object checkpointmodel.ObjectID, kind RecoveryArtifactKind) (string, string, error)
- func RecoveryBlocked(attention []Attention) bool
- func RecyclePrivateState(control outputcap.Directory) (bool, error)
- func RemoveExact(directory outputcap.Directory, name string, expected []byte) (error, error)
- func RemoveExactTemporary(directory outputcap.Directory, name string, expected []byte) error
- func RemoveTemporary(directory outputcap.Directory, name string, file outputcap.FileIdentity) error
- func TemporaryName(name string, encoded []byte, attempt int) string
- func ValidShard(name string) bool
- func WriteFile(file outputcap.MutableFile, encoded []byte) error
- type ActiveAdmission
- func (admission *ActiveAdmission) BeginReservation(spec destinationauthority.ReservationClaimSpec) (destinationauthority.ReservationClaimHandle, ...)
- func (admission *ActiveAdmission) BindCandidateReservation(claim destinationauthority.ReservationClaim) error
- func (admission *ActiveAdmission) Close() error
- func (admission *ActiveAdmission) Create(record checkpointmodel.OrdinaryOperationRecord, ...) (*OperationRegistryLease, error)
- func (admission *ActiveAdmission) PrepareCandidate(operation receivecontract.OperationID) error
- func (admission *ActiveAdmission) RequireAttention() error
- func (admission *ActiveAdmission) RollbackCandidate() error
- type ActiveLookup
- type ActiveLookupState
- type Attention
- type AttentionCode
- type CandidateDurabilityWitness
- type Error
- type ErrorCode
- type FileExecutionLineageSlot
- type FileExecutionStore
- func NewFileExecutionStore(repository *Repository) (*FileExecutionStore, error)
- func NewFileExecutionStoreWithStagePolicy(repository *Repository, stagePolicy StagePolicy) (*FileExecutionStore, error)
- func NewFreshFileExecutionStore(repository *Repository) (*FileExecutionStore, error)
- func NewFreshFileExecutionStoreWithStagePolicy(repository *Repository, stagePolicy StagePolicy) (*FileExecutionStore, error)
- func (store *FileExecutionStore) ApplyRetirement(ctx context.Context, object checkpointmodel.ObjectID, ...) (observation fileexecution.OwnedObservation, resultErr error)
- func (store *FileExecutionStore) CleanupOwned(ctx context.Context) error
- func (store *FileExecutionStore) CreateOwnedFile(ctx context.Context, destination fileexecution.FileDestination, ...) (file fileexecution.OwnedFile, observation fileexecution.OwnedObservation, ...)
- func (store *FileExecutionStore) FinalMatchesPublication(ctx context.Context, object checkpointmodel.ObjectID, exactSize uint64, ...) (matches bool, resultErr error)
- func (store *FileExecutionStore) InstallInitial(ctx context.Context, key fileexecution.CheckpointKey, ...) (fileexecution.InitialCheckpointObservation, error)
- func (store *FileExecutionStore) Inventory() ([]FileExecutionLineageSlot, []Attention, error)
- func (store *FileExecutionStore) Lookup(ctx context.Context, key fileexecution.CheckpointKey) (fileexecution.CheckpointResolution, error)
- func (store *FileExecutionStore) LookupDeliveredRecord(ctx context.Context, spec checkpointmodel.CheckpointLineageSpec) (checkpointmodel.Record, bool, error)
- func (store *FileExecutionStore) ObserveOwnedObject(ctx context.Context, object checkpointmodel.ObjectID, exactSize uint64) (observation fileexecution.OwnedObservation, resultErr error)
- func (store *FileExecutionStore) OpenOwnedFile(ctx context.Context, object checkpointmodel.ObjectID, exactSize uint64, ...) (file fileexecution.OwnedFile, observation fileexecution.OwnedObservation, ...)
- func (store *FileExecutionStore) PublishOwnedNoReplace(ctx context.Context, object checkpointmodel.ObjectID, exactSize uint64, ...) (linked outputcap.ObservedFile, resultErr error)
- func (store *FileExecutionStore) ReclaimedCandidateCount() uint64
- func (store *FileExecutionStore) RecordCount() uint64
- func (store *FileExecutionStore) Replace(ctx context.Context, previous checkpointmodel.Record, ...) (fileexecution.CheckpointObservation, error)
- type LiveCleanupJournal
- func (journal *LiveCleanupJournal) Close() error
- func (journal *LiveCleanupJournal) Create(ticket checkpointmodel.LiveCleanupTicket) error
- func (journal *LiveCleanupJournal) Delete(ticket checkpointmodel.LiveCleanupTicket) error
- func (journal *LiveCleanupJournal) ReadBatch(maximumTickets int) (destinationauthority.LiveCleanupBatch, error)
- func (journal *LiveCleanupJournal) Replace(previous checkpointmodel.LiveCleanupTicket, ...) error
- type OperationPage
- type OperationPageCursor
- type OperationRegistry
- func (registry *OperationRegistry) AcquireOperationLease(operation receivecontract.OperationID) (*OperationRegistryLease, error)
- func (registry *OperationRegistry) BeginActive(key checkpointmodel.ActiveOperationKey) (ActiveAdmission, ActiveLookup, error)
- func (registry *OperationRegistry) BeginReservation(spec destinationauthority.ReservationClaimSpec) (destinationauthority.ReservationClaimHandle, ...)
- func (registry *OperationRegistry) Close() error
- func (registry *OperationRegistry) LookupActive(key checkpointmodel.ActiveOperationKey) (ActiveLookup, error)
- func (registry *OperationRegistry) LookupOperation(operation receivecontract.OperationID) (ActiveLookup, error)
- func (registry *OperationRegistry) PageOperations(cursor OperationPageCursor, maximum int) (OperationPage, error)
- func (registry *OperationRegistry) PageReservationClaims(cursor ReservationClaimPageCursor, maximum int) (ReservationClaimPage, error)
- func (registry *OperationRegistry) RecoveryProof(record checkpointmodel.OrdinaryOperationRecord) (ReservationRecoveryProof, error)
- func (registry *OperationRegistry) ReleaseReservation(claim destinationauthority.ReservationClaim, ...) error
- type OperationRegistryLease
- func (lease *OperationRegistryLease) CleanupEmptyFileState() (resultErr error)
- func (lease *OperationRegistryLease) Close() error
- func (lease *OperationRegistryLease) DeleteTerminal() error
- func (lease *OperationRegistryLease) Deleted() bool
- func (lease *OperationRegistryLease) InstallNameMapping(name string, encoded []byte) error
- func (lease *OperationRegistryLease) OpenFileState(create bool) (outputcap.Directory, error)
- func (lease *OperationRegistryLease) OpenNameState(create bool) (outputcap.Directory, error)
- func (lease *OperationRegistryLease) ReclaimNameCandidates(directory outputcap.Directory) error
- func (lease *OperationRegistryLease) Record() checkpointmodel.OrdinaryOperationRecord
- func (lease *OperationRegistryLease) Replace(previous checkpointmodel.OrdinaryOperationRecord, ...) error
- type OwnershipStatus
- type ReconciliationError
- func (failure *ReconciliationError) Error() string
- func (failure *ReconciliationError) Fault() transferfault.Fault
- func (failure *ReconciliationError) NativeClass() (outputcap.NativeErrorClass, bool)
- func (failure *ReconciliationError) Step() ReconciliationStep
- func (failure *ReconciliationError) Unwrap() error
- type ReconciliationStep
- type RecoveryArtifactKind
- type Repository
- func (repository *Repository) Close() error
- func (repository *Repository) Create(record checkpointmodel.Record) (checkpointmodel.Record, error)
- func (repository *Repository) Reconcile(witness CandidateDurabilityWitness) (Snapshot, error)
- func (repository *Repository) Remove(record checkpointmodel.Record) error
- func (repository *Repository) Reopen(recordID checkpointmodel.RecordID) (checkpointmodel.Record, error)
- func (repository *Repository) Replace(previous, next checkpointmodel.Record) (checkpointmodel.Record, error)
- type ReservationClaimHandle
- func (handle *ReservationClaimHandle) BindDirectoryIdentity(persistentIdentity []byte) (destinationauthority.ReservationMetadataClaimOutcome, error)
- func (handle *ReservationClaimHandle) BindReservation(reservation receivecontract.DestinationReservation) (destinationauthority.ReservationMetadataClaimOutcome, error)
- func (handle *ReservationClaimHandle) Claim() destinationauthority.ReservationClaim
- func (handle *ReservationClaimHandle) Close() error
- func (handle *ReservationClaimHandle) Rollback() (destinationauthority.ReservationMetadataClaimOutcome, error)
- type ReservationClaimPage
- type ReservationClaimPageCursor
- type ReservationRecoveryProof
- type Snapshot
- type StagePolicy
Constants ¶
const ( ControlDirectory = ".windshare-output" CheckpointsDirectory = "checkpoints" RecordsDirectory = "records" AnchorsDirectory = "anchors" StagesDirectory = "stages" OwnershipFile = "marker" )
const ( OrdinaryRegistryDirectoryV1 = "ordinary-v1" MaximumOrdinaryOperationPageSizeV1 = 256 MaximumOrdinaryOperationRecordsV1 = 65_536 MaximumActiveMatchesV1 = 2 )
const ( ShardLimit = checkpointmodel.CheckpointShardBuckets + 1 EntryLimit = checkpointmodel.MaxCheckpointRecordsPerOperation + 1 )
Variables ¶
This section is empty.
Functions ¶
func InstallCreate ¶
func InstallReplace ¶
func InstallReplaceStrict ¶
InstallReplaceStrict differs from the idempotent generic replacement helper: callers use it when an exact predecessor generation is the authority. A completed retry with next already present is therefore rejected rather than allowing a stale actor to report success.
func IsTemporaryName ¶
func MatchesTemporaryName ¶
func OperationTemporaryName ¶
func OperationTemporaryName(operation receivecontract.OperationID, name string, encoded []byte, attempt int) string
OperationTemporaryName reserves a scratch slot within an authenticated, exclusively leased operation. It grants no authority to reuse the payload.
func ParseRecoveryArtifactLocation ¶
func ParseRecoveryArtifactLocation( shard string, name string, kind RecoveryArtifactKind, ) (checkpointmodel.ObjectID, error)
func RecoveryArtifactLocation ¶
func RecoveryArtifactLocation( object checkpointmodel.ObjectID, kind RecoveryArtifactKind, ) (string, string, error)
func RecoveryBlocked ¶
func RecyclePrivateState ¶
RecyclePrivateState removes empty current-generation infrastructure after the destination lifecycle protocol proves that no bound process can still use it. Recovery evidence and every unknown or non-empty shape are preserved.
func RemoveExact ¶
RemoveExact makes the authenticated checkpoint image the deletion authority. A caller holding only a record name must not be able to retire a checkpoint that another recovery decision replaced after it was observed.
func RemoveExactTemporary ¶
func RemoveTemporary ¶
func ValidShard ¶
Types ¶
type ActiveAdmission ¶
type ActiveAdmission struct {
// contains filtered or unexported fields
}
ActiveAdmission holds the key lock across an active miss, shape resolution, reservation claiming, and active-last publication. That ordering prevents two processes from independently treating the same key as absent.
func (*ActiveAdmission) BeginReservation ¶
func (admission *ActiveAdmission) BeginReservation( spec destinationauthority.ReservationClaimSpec, ) (destinationauthority.ReservationClaimHandle, destinationauthority.ReservationMetadataClaimOutcome, error)
BeginReservation makes the held admission the consumer-facing metadata claimer. It links the key-addressable candidate to the exact global claim before returning the handle to destination authority, so BindReservation and every later public mutation are always reachable after a crash.
func (*ActiveAdmission) BindCandidateReservation ¶
func (admission *ActiveAdmission) BindCandidateReservation( claim destinationauthority.ReservationClaim, ) error
BindCandidateReservation records the exact claim coordinate before the authority performs the first public mutation. The authority-owned handle may subsequently advance its claim generation; the candidate retains the deterministic token so reconciliation never pages the global claim table.
func (*ActiveAdmission) Close ¶
func (admission *ActiveAdmission) Close() error
func (*ActiveAdmission) Create ¶
func (admission *ActiveAdmission) Create( record checkpointmodel.OrdinaryOperationRecord, claim destinationauthority.ReservationClaim, ) (*OperationRegistryLease, error)
func (*ActiveAdmission) PrepareCandidate ¶
func (admission *ActiveAdmission) PrepareCandidate(operation receivecontract.OperationID) error
PrepareCandidate publishes the key-addressable pre-index marker before any public reservation mutation. A retry can therefore never mistake an indeterminate pre-index cut for a clean active miss.
func (*ActiveAdmission) RequireAttention ¶
func (admission *ActiveAdmission) RequireAttention() error
func (*ActiveAdmission) RollbackCandidate ¶
func (admission *ActiveAdmission) RollbackCandidate() error
type ActiveLookup ¶
type ActiveLookup struct {
// contains filtered or unexported fields
}
func (ActiveLookup) Record ¶
func (lookup ActiveLookup) Record() checkpointmodel.OrdinaryOperationRecord
func (ActiveLookup) RecoveryProof ¶
func (lookup ActiveLookup) RecoveryProof() ReservationRecoveryProof
func (ActiveLookup) State ¶
func (lookup ActiveLookup) State() ActiveLookupState
func (*ActiveLookup) TakeLease ¶
func (lookup *ActiveLookup) TakeLease() *OperationRegistryLease
TakeLease transfers the exact operation lock only for a reopenable match. Returning a pointer keeps ownership explicit: closing a copied value could otherwise release a lease still used by the runtime.
type ActiveLookupState ¶
type ActiveLookupState uint8
const ( ActiveLookupNone ActiveLookupState = iota + 1 ActiveLookupReopenable ActiveLookupAlreadyRunning ActiveLookupNeedsAttention ActiveLookupAmbiguous )
func (ActiveLookupState) Valid ¶
func (state ActiveLookupState) Valid() bool
type Attention ¶
type Attention struct {
// contains filtered or unexported fields
}
func (Attention) BlocksRecovery ¶
Uninstalled images never grant range authority. An interrupted write can leave one unreadable without changing the independently validated fixed record. Owned interrupted images are reclaimed. Unrecognized objects remain visible to cleanup without vetoing recovery of independently validated siblings.
func (Attention) Code ¶
func (attention Attention) Code() AttentionCode
type AttentionCode ¶
type AttentionCode string
const ( AttentionUnknownShard AttentionCode = "unknown-shard" AttentionUnknownEntry AttentionCode = "unknown-entry" AttentionCorruptRecord AttentionCode = "corrupt-record" AttentionInvalidBinding AttentionCode = "invalid-binding" AttentionUncommittedRecord AttentionCode = "uncommitted-record" AttentionInvalidCandidate AttentionCode = "invalid-candidate" AttentionOrphanedCandidate AttentionCode = "orphaned-candidate" AttentionConflictingCandidate AttentionCode = "conflicting-candidate" )
func (AttentionCode) Valid ¶
func (code AttentionCode) Valid() bool
type CandidateDurabilityWitness ¶
type CandidateDurabilityWitness func(checkpointmodel.Record) (bool, error)
CandidateDurabilityWitness proves that a candidate record's owned stage and anchor still name the durable file cut that preceded candidate publication. The repository owns promotion; the file engine supplies only the platform observation it is uniquely able to make.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error retains a raw cause only for immediate diagnostics. Its code is the sole authority that may cross into settlement policy.
type ErrorCode ¶
type ErrorCode string
ErrorCode is the closed checkpoint boundary vocabulary consumed by fault normalization. Callers must not infer policy from wrapped filesystem errors.
func ErrorCodeFor ¶
ErrorCodeFor preserves the classification supplied by an immediate storage boundary. Reclassifying its diagnostic cause could turn record corruption into a destination-wide I/O failure, or hide an explicitly reported I/O fault. Only failures without a direct classification use provider-cause inference.
type FileExecutionLineageSlot ¶
type FileExecutionLineageSlot struct {
// contains filtered or unexported fields
}
Inventory is a management operation; ordinary continuation uses exact lookup.
func (FileExecutionLineageSlot) CanonicalPath ¶
func (s FileExecutionLineageSlot) CanonicalPath() string
func (FileExecutionLineageSlot) Decision ¶
func (s FileExecutionLineageSlot) Decision() checkpointmodel.CheckpointLineageDecision
func (FileExecutionLineageSlot) PhysicalRecords ¶
func (s FileExecutionLineageSlot) PhysicalRecords() []checkpointmodel.Record
func (FileExecutionLineageSlot) Record ¶
func (s FileExecutionLineageSlot) Record() (checkpointmodel.Record, bool)
type FileExecutionStore ¶
type FileExecutionStore struct {
// contains filtered or unexported fields
}
FileExecutionStore binds the native file engine to the physical checkpoint repository. Its logical authority state is shared through the operation lease, so separate adapters cannot both observe an absent lineage and install competing objects.
func NewFileExecutionStore ¶
func NewFileExecutionStore(repository *Repository) (*FileExecutionStore, error)
func NewFileExecutionStoreWithStagePolicy ¶
func NewFileExecutionStoreWithStagePolicy( repository *Repository, stagePolicy StagePolicy, ) (*FileExecutionStore, error)
func NewFreshFileExecutionStore ¶
func NewFreshFileExecutionStore(repository *Repository) (*FileExecutionStore, error)
NewFreshFileExecutionStore deliberately skips repository enumeration. It is valid only for a newly published ordinary operation whose private namespace cannot contain an earlier file record.
func NewFreshFileExecutionStoreWithStagePolicy ¶
func NewFreshFileExecutionStoreWithStagePolicy( repository *Repository, stagePolicy StagePolicy, ) (*FileExecutionStore, error)
func (*FileExecutionStore) ApplyRetirement ¶
func (store *FileExecutionStore) ApplyRetirement( ctx context.Context, object checkpointmodel.ObjectID, step fileexecution.RetirementStep, ) (observation fileexecution.OwnedObservation, resultErr error)
func (*FileExecutionStore) CleanupOwned ¶
func (store *FileExecutionStore) CleanupOwned(ctx context.Context) error
CleanupOwned retires every authenticated physical record, including records in conflict slots and uninstalled images that cannot authorize recovery. Shared object claims are retired once; each image survives until its owned data is durably removed, regardless of the fixed record's generation.
func (*FileExecutionStore) CreateOwnedFile ¶
func (store *FileExecutionStore) CreateOwnedFile( ctx context.Context, destination fileexecution.FileDestination, object checkpointmodel.ObjectID, exactSize uint64, ) (file fileexecution.OwnedFile, observation fileexecution.OwnedObservation, resultErr error)
func (*FileExecutionStore) FinalMatchesPublication ¶
func (store *FileExecutionStore) FinalMatchesPublication( ctx context.Context, object checkpointmodel.ObjectID, exactSize uint64, final outputcap.FileIdentity, ) (matches bool, resultErr error)
FinalMatchesPublication reconciles interrupted publication using retained evidence, without granting deletion authority. Durable receipts bypass it.
func (*FileExecutionStore) InstallInitial ¶
func (store *FileExecutionStore) InstallInitial( ctx context.Context, key fileexecution.CheckpointKey, candidate checkpointmodel.Record, ) (fileexecution.InitialCheckpointObservation, error)
func (*FileExecutionStore) Inventory ¶
func (store *FileExecutionStore) Inventory() ([]FileExecutionLineageSlot, []Attention, error)
Inventory is reserved for explicit management and cleanup. Ordinary transfer loads each logical file on demand, so unrelated state cannot delay its start. Attention describes observed repository anomalies; a failed inventory returns an error because an incomplete observation cannot establish record corruption.
func (*FileExecutionStore) Lookup ¶
func (store *FileExecutionStore) Lookup( ctx context.Context, key fileexecution.CheckpointKey, ) (fileexecution.CheckpointResolution, error)
func (*FileExecutionStore) LookupDeliveredRecord ¶
func (store *FileExecutionStore) LookupDeliveredRecord(ctx context.Context, spec checkpointmodel.CheckpointLineageSpec) (checkpointmodel.Record, bool, error)
func (*FileExecutionStore) ObserveOwnedObject ¶
func (store *FileExecutionStore) ObserveOwnedObject( ctx context.Context, object checkpointmodel.ObjectID, exactSize uint64, ) (observation fileexecution.OwnedObservation, resultErr error)
func (*FileExecutionStore) OpenOwnedFile ¶
func (store *FileExecutionStore) OpenOwnedFile( ctx context.Context, object checkpointmodel.ObjectID, exactSize uint64, writable bool, ) (file fileexecution.OwnedFile, observation fileexecution.OwnedObservation, resultErr error)
func (*FileExecutionStore) PublishOwnedNoReplace ¶
func (store *FileExecutionStore) PublishOwnedNoReplace( ctx context.Context, object checkpointmodel.ObjectID, exactSize uint64, parent outputcap.Directory, name string, ) (linked outputcap.ObservedFile, resultErr error)
PublishOwnedNoReplace exposes the same data object through a move or a native hard link. The caller still reconciles placement before recording delivery.
func (*FileExecutionStore) ReclaimedCandidateCount ¶
func (store *FileExecutionStore) ReclaimedCandidateCount() uint64
func (*FileExecutionStore) RecordCount ¶
func (store *FileExecutionStore) RecordCount() uint64
func (*FileExecutionStore) Replace ¶
func (store *FileExecutionStore) Replace( ctx context.Context, previous checkpointmodel.Record, next checkpointmodel.Record, ) (fileexecution.CheckpointObservation, error)
type LiveCleanupJournal ¶
type LiveCleanupJournal struct {
// contains filtered or unexported fields
}
func OpenLiveCleanupJournal ¶
func OpenLiveCleanupJournal(control outputcap.Directory) (journal LiveCleanupJournal, resultErr error)
OpenLiveCleanupJournal owns control/cleanup-v1/tickets. The cleanup-v1 parent remains the proof namespace for stage objects; separating its ticket child is why ReadBatch never mistakes an ordinary-profile stage for unknown metadata.
func (*LiveCleanupJournal) Close ¶
func (journal *LiveCleanupJournal) Close() error
func (*LiveCleanupJournal) Create ¶
func (journal *LiveCleanupJournal) Create(ticket checkpointmodel.LiveCleanupTicket) error
func (*LiveCleanupJournal) Delete ¶
func (journal *LiveCleanupJournal) Delete(ticket checkpointmodel.LiveCleanupTicket) error
func (*LiveCleanupJournal) ReadBatch ¶
func (journal *LiveCleanupJournal) ReadBatch( maximumTickets int, ) (destinationauthority.LiveCleanupBatch, error)
func (*LiveCleanupJournal) Replace ¶
func (journal *LiveCleanupJournal) Replace( previous checkpointmodel.LiveCleanupTicket, next checkpointmodel.LiveCleanupTicket, ) error
type OperationPage ¶
type OperationPage struct {
// contains filtered or unexported fields
}
func ReadOperationPage ¶
func ReadOperationPage(control outputcap.Directory, cursor OperationPageCursor, maximum int) (OperationPage, error)
ReadOperationPage observes existing records without locks, repairs, or creation. Its results describe blocked inventory and never grant mutation authority.
func (OperationPage) Next ¶
func (page OperationPage) Next() OperationPageCursor
func (OperationPage) Records ¶
func (page OperationPage) Records() []checkpointmodel.OrdinaryOperationRecord
func (OperationPage) Unknown ¶
func (page OperationPage) Unknown() bool
type OperationPageCursor ¶
type OperationPageCursor struct {
// contains filtered or unexported fields
}
func NewOperationPageCursor ¶
func NewOperationPageCursor(after receivecontract.OperationID) OperationPageCursor
func (OperationPageCursor) After ¶
func (cursor OperationPageCursor) After() (receivecontract.OperationID, bool)
func (OperationPageCursor) IsZero ¶
func (cursor OperationPageCursor) IsZero() bool
type OperationRegistry ¶
type OperationRegistry struct {
// contains filtered or unexported fields
}
func OpenOperationRegistry ¶
func OpenOperationRegistry(control outputcap.Directory) (registry OperationRegistry, resultErr error)
OpenOperationRegistry creates or authenticates only ordinary-v1 below the already-authenticated destination control directory. It never probes the public output tree and never reads the legacy checkpoint lookup namespace.
func (*OperationRegistry) AcquireOperationLease ¶
func (registry *OperationRegistry) AcquireOperationLease( operation receivecontract.OperationID, ) (*OperationRegistryLease, error)
AcquireOperationLease is reserved for explicit resume/list/discard flows. Ordinary first-download admission uses ActiveAdmission and never inventories.
func (*OperationRegistry) BeginActive ¶
func (registry *OperationRegistry) BeginActive( key checkpointmodel.ActiveOperationKey, ) (ActiveAdmission, ActiveLookup, error)
func (*OperationRegistry) BeginReservation ¶
func (registry *OperationRegistry) BeginReservation( spec destinationauthority.ReservationClaimSpec, ) (destinationauthority.ReservationClaimHandle, destinationauthority.ReservationMetadataClaimOutcome, error)
BeginReservation durably claims the platform-canonical top-level name before the public absence probe or directory creation. A collision is decided solely by the authenticated private claim table; public names are never used as locks.
func (*OperationRegistry) Close ¶
func (registry *OperationRegistry) Close() error
func (*OperationRegistry) LookupActive ¶
func (registry *OperationRegistry) LookupActive( key checkpointmodel.ActiveOperationKey, ) (ActiveLookup, error)
LookupActive is observation-only. New-operation admission must use BeginActive so the miss remains serialized until active-last publication.
func (*OperationRegistry) LookupOperation ¶
func (registry *OperationRegistry) LookupOperation(operation receivecontract.OperationID) (ActiveLookup, error)
LookupOperation takes the same exact lease as automatic continuation without inspecting or replacing the selection's automatic match.
func (*OperationRegistry) PageOperations ¶
func (registry *OperationRegistry) PageOperations( cursor OperationPageCursor, maximum int, ) (OperationPage, error)
func (*OperationRegistry) PageReservationClaims ¶
func (registry *OperationRegistry) PageReservationClaims( cursor ReservationClaimPageCursor, maximum int, ) (ReservationClaimPage, error)
PageReservationClaims is an explicit cleanup/inventory path. Active lookup never calls it, so fresh admission cost is independent of stale claim count.
func (*OperationRegistry) RecoveryProof ¶
func (registry *OperationRegistry) RecoveryProof( record checkpointmodel.OrdinaryOperationRecord, ) (ReservationRecoveryProof, error)
RecoveryProof authenticates the immutable row against its exact reservation claim. Callers must already hold the operation lease before using the proof to reopen public authority.
func (*OperationRegistry) ReleaseReservation ¶
func (registry *OperationRegistry) ReleaseReservation( claim destinationauthority.ReservationClaim, expectedOperation receivecontract.OperationID, ) error
type OperationRegistryLease ¶
type OperationRegistryLease struct {
// contains filtered or unexported fields
}
func (*OperationRegistryLease) CleanupEmptyFileState ¶
func (lease *OperationRegistryLease) CleanupEmptyFileState() (resultErr error)
CleanupEmptyFileState is restartable after every directory-removal cut. It removes only authenticated, empty ordinary checkpoint namespaces; any remaining or unknown entry keeps terminal cleanup pending.
func (*OperationRegistryLease) Close ¶
func (lease *OperationRegistryLease) Close() error
func (*OperationRegistryLease) DeleteTerminal ¶
func (lease *OperationRegistryLease) DeleteTerminal() error
DeleteTerminal removes crash-only metadata after exact owned cleanup. It never touches the public final or result root; the reservation claim is merely released so future operations can choose names from current public reality.
func (*OperationRegistryLease) Deleted ¶
func (lease *OperationRegistryLease) Deleted() bool
func (*OperationRegistryLease) InstallNameMapping ¶
func (lease *OperationRegistryLease) InstallNameMapping(name string, encoded []byte) error
InstallNameMapping uses operation-owned scratch slots so a torn metadata write can be retired on restart without confusing it with received content.
func (*OperationRegistryLease) OpenFileState ¶
func (lease *OperationRegistryLease) OpenFileState(create bool) (outputcap.Directory, error)
OpenFileState retains file checkpoints below the exact leased operation. A fresh operation may create the namespace without enumerating it; only a matched resume asks the file store to reconcile its bounded contents.
func (*OperationRegistryLease) OpenNameState ¶
func (lease *OperationRegistryLease) OpenNameState(create bool) (outputcap.Directory, error)
OpenNameState is lazy: normal names never create an extra recovery namespace.
func (*OperationRegistryLease) ReclaimNameCandidates ¶
func (lease *OperationRegistryLease) ReclaimNameCandidates(directory outputcap.Directory) error
ReclaimNameCandidates never interprets scratch bytes as a committed mapping.
func (*OperationRegistryLease) Record ¶
func (lease *OperationRegistryLease) Record() checkpointmodel.OrdinaryOperationRecord
func (*OperationRegistryLease) Replace ¶
func (lease *OperationRegistryLease) Replace( previous checkpointmodel.OrdinaryOperationRecord, next checkpointmodel.OrdinaryOperationRecord, ) error
type OwnershipStatus ¶
type OwnershipStatus uint8
const ( OwnershipMatched OwnershipStatus = iota + 1 OwnershipAbsent OwnershipMismatch OwnershipRecoverable )
type ReconciliationError ¶
type ReconciliationError struct {
// contains filtered or unexported fields
}
ReconciliationError seals the safe recovery diagnosis while the provider's typed native classification is still reachable. The raw cause remains private diagnostic evidence and never authorizes a later policy decision.
func (*ReconciliationError) Error ¶
func (failure *ReconciliationError) Error() string
func (*ReconciliationError) Fault ¶
func (failure *ReconciliationError) Fault() transferfault.Fault
func (*ReconciliationError) NativeClass ¶
func (failure *ReconciliationError) NativeClass() (outputcap.NativeErrorClass, bool)
func (*ReconciliationError) Step ¶
func (failure *ReconciliationError) Step() ReconciliationStep
func (*ReconciliationError) Unwrap ¶
func (failure *ReconciliationError) Unwrap() error
type ReconciliationStep ¶
type ReconciliationStep uint8
ReconciliationStep is the last authoritative checkpoint-recovery decision reached before a candidate promotion failed. Cleanup is deliberately absent: closing capabilities cannot rewrite the primary recovery outcome.
const ( ReconciliationCandidateObservation ReconciliationStep = iota + 1 ReconciliationStageDurability ReconciliationNamespaceDurability ReconciliationRecordPromotion )
func (ReconciliationStep) String ¶
func (step ReconciliationStep) String() string
func (ReconciliationStep) Valid ¶
func (step ReconciliationStep) Valid() bool
type RecoveryArtifactKind ¶
type RecoveryArtifactKind uint8
const ( RecoveryStage RecoveryArtifactKind = iota + 1 RecoveryAnchor )
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository owns one leased ordinary operation's FileCheckpointV2 records and their exact native data-object coordinates.
func OpenOrdinaryFileRepository ¶
func OpenOrdinaryFileRepository( lease *OperationRegistryLease, binding checkpointmodel.Binding, create bool, ) (result Repository, resultErr error)
OpenOrdinaryFileRepository binds the unchanged FileCheckpointV2 codec to one leased ordinary operation. The operation registry, not a destination-global lookup tree, owns this namespace and therefore bounds every resume scan.
func (*Repository) Close ¶
func (repository *Repository) Close() error
func (*Repository) Create ¶
func (repository *Repository) Create(record checkpointmodel.Record) (checkpointmodel.Record, error)
Create returns the exact installed record only after content and namespace durability have both succeeded. Readability following an error is not a commit receipt; callers must freeze authority until recovery reconciles that case.
func (*Repository) Reconcile ¶
func (repository *Repository) Reconcile(witness CandidateDurabilityWitness) (Snapshot, error)
func (*Repository) Remove ¶
func (repository *Repository) Remove(record checkpointmodel.Record) error
func (*Repository) Reopen ¶
func (repository *Repository) Reopen(recordID checkpointmodel.RecordID) (checkpointmodel.Record, error)
func (*Repository) Replace ¶
func (repository *Repository) Replace(previous, next checkpointmodel.Record) (checkpointmodel.Record, error)
type ReservationClaimHandle ¶
type ReservationClaimHandle struct {
// contains filtered or unexported fields
}
func (*ReservationClaimHandle) BindDirectoryIdentity ¶
func (handle *ReservationClaimHandle) BindDirectoryIdentity( persistentIdentity []byte, ) (destinationauthority.ReservationMetadataClaimOutcome, error)
func (*ReservationClaimHandle) BindReservation ¶
func (handle *ReservationClaimHandle) BindReservation( reservation receivecontract.DestinationReservation, ) (destinationauthority.ReservationMetadataClaimOutcome, error)
func (*ReservationClaimHandle) Claim ¶
func (handle *ReservationClaimHandle) Claim() destinationauthority.ReservationClaim
func (*ReservationClaimHandle) Close ¶
func (handle *ReservationClaimHandle) Close() error
func (*ReservationClaimHandle) Rollback ¶
func (handle *ReservationClaimHandle) Rollback() (destinationauthority.ReservationMetadataClaimOutcome, error)
Rollback is allowed only before a public result can exist. Later phases need exact cleanup evidence and therefore remain durable for reconciliation.
type ReservationClaimPage ¶
type ReservationClaimPage struct {
// contains filtered or unexported fields
}
func (ReservationClaimPage) Next ¶
func (page ReservationClaimPage) Next() ReservationClaimPageCursor
func (ReservationClaimPage) Records ¶
func (page ReservationClaimPage) Records() []checkpointmodel.ReservationClaimRecord
func (ReservationClaimPage) Unknown ¶
func (page ReservationClaimPage) Unknown() bool
type ReservationClaimPageCursor ¶
type ReservationClaimPageCursor struct {
// contains filtered or unexported fields
}
func NewReservationClaimPageCursor ¶
func NewReservationClaimPageCursor(token [sha256.Size]byte) ReservationClaimPageCursor
func (ReservationClaimPageCursor) IsZero ¶
func (cursor ReservationClaimPageCursor) IsZero() bool
type ReservationRecoveryProof ¶
type ReservationRecoveryProof struct {
// contains filtered or unexported fields
}
ReservationRecoveryProof is the compact, exact-open proof consumed by destination recovery. Canonical reservation bytes remain in ReceiveIntent; this value contributes only authenticated private metadata and exact native identity evidence.
func (ReservationRecoveryProof) Claim ¶
func (proof ReservationRecoveryProof) Claim() destinationauthority.ReservationClaim
func (ReservationRecoveryProof) Clone ¶
func (proof ReservationRecoveryProof) Clone() ReservationRecoveryProof
func (ReservationRecoveryProof) PersistentIdentity ¶
func (proof ReservationRecoveryProof) PersistentIdentity() []byte
func (ReservationRecoveryProof) Valid ¶
func (proof ReservationRecoveryProof) Valid() bool
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
func (Snapshot) ReclaimedCandidateCount ¶
func (Snapshot) Records ¶
func (snapshot Snapshot) Records() []checkpointmodel.Record
type StagePolicy ¶
type StagePolicy uint8
StagePolicy describes permission inheritance independently from crash cleanup.
const ( PrivateStage StagePolicy = iota InheritFinalParent )
Source Files
¶
- candidate_contention_other.go
- cleanup_batch.go
- errors.go
- file_execution_lineage.go
- file_execution_owned.go
- file_execution_publication.go
- file_execution_store.go
- installation_candidates.go
- live_cleanup_journal.go
- namespace.go
- operation_registry.go
- operation_registry_lease.go
- operation_registry_page.go
- private_state_recycler.go
- records.go
- recovery_witness.go
- repository.go
- repository_reconcile.go
- reservation_claims.go