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
@@ -36,6 +36,18 @@ struct CommittedCheckpoint {
RegionHead head{};
std::vector<std::uint8_t> manifest;
};
struct CellularProfileMigrationRecord {
std::uint64_t source_sequence{};
Uuid source_commit{};
Sha256Digest source_manifest_sha256{}, source_payload_sha256{};
std::vector<std::uint8_t> source_versions;
std::uint64_t target_sequence{};
Uuid target_commit{};
Sha256Digest target_manifest_sha256{}, target_payload_sha256{};
std::vector<std::uint8_t> target_versions;
friend bool operator==(const CellularProfileMigrationRecord&,
const CellularProfileMigrationRecord&) = default;
};
// Schema v8 (ADR-0068): authority is granted only to a retained, unretired build;
// a retired or unknown build is unsupported and must not keep retrying.
@@ -83,6 +95,12 @@ publish_cellular_checkpoint(Postgres& db, std::span<const std::uint8_t> manifest
std::span<const std::uint8_t> decisions,
std::span<const std::uint8_t> actions,
std::span<const std::uint8_t> trace, std::chrono::milliseconds timeout);
[[nodiscard]] std::expected<RegionHead, LeaseStoreFailure>
publish_cellular_profile_migration(Postgres& db, std::span<const std::uint8_t> manifest,
std::chrono::milliseconds timeout);
[[nodiscard]] std::expected<std::optional<CellularProfileMigrationRecord>, LeaseStoreFailure>
load_cellular_profile_migration(Postgres& db, RegionKey key, const LeaseGrant& lease,
const Uuid& commit, std::chrono::milliseconds timeout);
enum class Resolution : std::uint8_t {
committed, // Exact bytes are durable; receipt holds the head. Grants no authority.