M12.4: retain read-only destination migration stages
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 2m25s
Foundation / checks (network) (push) Successful in 20m44s
Foundation / checks (client) (push) Successful in 21m57s
Foundation / checks (tsan) (push) Successful in 22m46s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (checks) (push) Canceled after 30m2s
Foundation / checks (postgres) (push) Canceled after 29m56s

This commit is contained in:
dingo
2026-10-18 09:32:50 -04:00
parent c625a4cb68
commit 0515702964
21 changed files with 1023 additions and 21 deletions
@@ -42,4 +42,36 @@ abort_cellular_migration_freeze(Postgres&, RegionKey, const LeaseGrant&, const U
[[nodiscard]] std::expected<std::optional<CellularMigrationFreeze>, RecoveryFailure>
load_cellular_migration_freeze(Postgres&, const FilesystemObjectStore&, RegionKey,
const LeaseGrant&, std::chrono::milliseconds timeout);
struct CellularMigrationStagePrepared {
RegionKey key{}; // Destination region.
std::vector<std::uint8_t> trace;
VerifiedObject ghost;
};
struct CellularMigrationStage {
CellularMigrationFreeze freeze;
VerifiedObject ghost; // Read-only evidence, never an ownership receipt.
};
struct CellularMigrationStageFailure {
PublicationError kind{};
LeaseStoreFailure store{};
ObjectError object{};
CellularMigrationStagePrepared prepared;
};
// Replay the retained pair, retain a source capsule and verified destination
// ghost in the destination namespace, then freeze its unchanged exact head.
[[nodiscard]] std::expected<CellularMigrationStage, CellularMigrationStageFailure>
stage_cellular_migration(Postgres&, const FilesystemObjectStore& source_objects,
const FilesystemObjectStore& destination_objects,
const LeaseGrant& destination_lease, const CommittedCheckpoint& source,
const CommittedCheckpoint& destination,
const server::CellularMigrationTrace&, std::chrono::milliseconds timeout,
const PublishHooks& hooks = {});
[[nodiscard]] std::expected<CellularMigrationStage, CellularMigrationStageFailure>
retry_cellular_migration_stage(Postgres&, const LeaseGrant&, const CellularMigrationStagePrepared&,
std::chrono::milliseconds timeout);
// Fresh destination authority; complete local capsule and ghost replay.
[[nodiscard]] std::expected<std::optional<CellularMigrationStage>, RecoveryFailure>
load_cellular_migration_stage(Postgres&, const FilesystemObjectStore&, RegionKey, const LeaseGrant&,
std::chrono::milliseconds timeout);
} // namespace evo::persistence