Interface IColdEventStoreMigration
- Namespace
- Excalibur.EventSourcing
- Assembly
- Excalibur.EventSourcing.Abstractions.dll
Optional administrative capability for an offline cold archive namespace cutover.
public interface IColdEventStoreMigration
Remarks
Obtain this capability from the same captured IColdEventStore instance used by the application. Decorators must explicitly mediate this capability and preserve their tenant restrictions; resolving a second provider or unwrapping a decorator does not establish the same storage binding. This optional administrative capability is not required for ordinary tiered-store startup. A tenant-confined decorator must deny namespace activation unless the entire namespace belongs to that tenant or the caller has explicit namespace-administrative authorization; checking only the current tenant cannot authorize an operation affecting other tenants.
Before activation, the operator must externally fence and drain every legacy operation and retry, including updated binaries. Old binaries must remain fenced afterwards. These methods do not acquire that fence. Retain the namespace marker, migration receipts, legacy source archives and typed archives; prohibit their deletion or replacement outside the protocol, including bucket/container recreation.
Activation prevents legacy access to the entire namespace but does not certify that any stream was migrated. A failed or cancelled operation may leave a durable marker, copied archive or receipt. Retry validates that state and resumes; deleting it to roll back is unsafe. Successful migration does not authorize deleting retained source archives or provide a cold-data erasure capability.
Methods
ActivateTypedLayoutAsync(CancellationToken)
Durably activates typed storage for the captured namespace after all legacy work is drained.
Task ActivateTypedLayoutAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
A task completed only after the immutable activation marker has been verified.
Remarks
This namespace-wide administrative operation precedes every typed object write, including migration copies. It is not performed implicitly by ordinary reads. Unknown or conflicting markers fail closed. A crash after activation leaves legacy access blocked; resume migration rather than removing the marker. Activation does not change this instance's frozen layout selection. Ordinary typed operations require an instance configured with TypedV2.
MigrateAsync(KeyedTenantPartition, string, string, CancellationToken)
Copies and verifies one complete legacy archive into its typed location after activation.
Task MigrateAsync(KeyedTenantPartition tenant, string aggregateId, string aggregateType, CancellationToken cancellationToken)
Parameters
tenantKeyedTenantPartitionThe exact tenant partition owning the archive.
aggregateIdstringThe case-sensitive aggregate identifier.
aggregateTypestringThe case-sensitive aggregate type proven by the complete legacy archive.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
A task completed after the retained source, typed archive and durable receipt have been verified.
Remarks
Missing, empty, ambiguous or malformed legacy archives are not guessed into a type. Published migrations can be retried after typed appends; the original baseline must still be preserved in full. Sparse versions are preserved. Existing conflicting typed data is never overwritten to force migration.