Add fenced cellular profile migration
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m56s
Foundation / checks (postgres) (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 0s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (client) (push) Canceled after 5m17s
Foundation / checks (checks) (push) Canceled after 5m21s
Foundation / checks (network) (push) Canceled after 3m14s

This commit is contained in:
dingo
2026-10-11 05:12:55 -04:00
parent beffec40d7
commit 66b8088f44
10 changed files with 600 additions and 10 deletions
@@ -112,6 +112,17 @@ struct CellularPublicationFailure {
ObjectError object{};
CellularPreparedCommit prepared;
};
struct CellularProfileMigrationPrepared {
RegionKey key{};
Uuid commit{};
std::vector<std::uint8_t> manifest;
};
struct CellularProfileMigrationFailure {
PublicationError kind{};
LeaseStoreFailure store{};
ObjectError object{};
CellularProfileMigrationPrepared prepared;
};
struct PublishedCellularBatch {
CommittedCheckpoint committed;
};
@@ -220,6 +231,16 @@ resolve_cellular_prepared(Postgres& db, const CellularPreparedCommit& prepared,
recover_cellular_checkpoint(Postgres& db, const FilesystemObjectStore& objects, RegionKey key,
const LeaseGrant& lease, std::span<const Sha256Digest> retained_builds,
std::chrono::milliseconds timeout);
// Leased, no-tick representation migration. The v1 payload is restored and
// converted in memory before one immutable v1-to-v2 migration commit is written.
[[nodiscard]] std::expected<CommittedCheckpoint, CellularProfileMigrationFailure>
migrate_cellular_profile_to_v2(Postgres& db, const FilesystemObjectStore& objects,
const LeaseGrant& lease, const CommittedCheckpoint& predecessor,
Uuid commit, const Sha256Digest& build,
std::chrono::milliseconds timeout);
[[nodiscard]] std::expected<CommittedCheckpoint, CellularProfileMigrationFailure>
retry_cellular_profile_migration(Postgres& db, const CellularProfileMigrationPrepared& prepared,
std::chrono::milliseconds timeout);
// After an `unknown` publication: resolve exactly the prepared bytes. A committed
// result yields the final batch; absent may be retried with the same prepared bytes