feat(persistence): admit durable maturing wildlife migrations
Foundation / checks (ecs) (push) Successful in 2m20s
Foundation / checks (deploy) (push) Successful in 4m7s
Foundation / checks (network) (push) Successful in 21m2s
Foundation / checks (client) (push) Successful in 22m21s
Foundation / checks (tsan) (push) Successful in 28m57s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 38m8s
Foundation / checks (checks) (push) Canceled after 38m19s

This commit is contained in:
dingo
2026-10-19 11:57:00 -04:00
parent ae2a2d78ba
commit d3a867a662
25 changed files with 578 additions and 82 deletions
+11 -9
View File
@@ -86,9 +86,10 @@ bool cuts(const CheckpointManifest& s, const CheckpointManifest& d,
const auto profile = t.representation == server::CellularMigrationRepresentation::individual
? CheckpointProfile::cellular_lives_v1
: CheckpointProfile::cellular_population_v1;
return t.format_version == 1 && supported(s) && supported(d) && encode_manifest(s) &&
encode_manifest(d) && s.cellular_versions == cellular_v10_versions &&
d.cellular_versions == cellular_v10_versions && s.profile == profile &&
const bool version = (t.format_version == 1 && s.cellular_versions == cellular_v10_versions) ||
(t.format_version == 2 && s.cellular_versions == cellular_v11_versions);
return version && supported(s) && supported(d) && encode_manifest(s) && encode_manifest(d) &&
d.cellular_versions == s.cellular_versions && s.profile == profile &&
d.profile == profile && s.sequence > 0 && d.sequence > 0 &&
s.key == RegionKey{t.world, t.request.source.region} &&
d.key == RegionKey{t.world, t.request.destination.region} && s.frame == t.frame &&
@@ -145,8 +146,7 @@ std::expected<CellularMigrationFreeze, CellularMigrationFailure>
retry_cellular_migration_freeze(Postgres& db, const LeaseGrant& lease,
const CellularMigrationPrepared& prepared, milliseconds timeout) {
const auto trace = server::decode_migration_trace(prepared.trace);
if (!trace || trace->format_version != 1 ||
prepared.key != RegionKey{trace->world, trace->request.source.region} ||
if (!trace || prepared.key != RegionKey{trace->world, trace->request.source.region} ||
lease.frame != trace->frame)
return std::unexpected(failed(PublicationError::candidate));
const std::array<std::string, 5> args{std::to_string(prepared.key.world),
@@ -341,8 +341,7 @@ retry_cellular_migration_stage(Postgres& db, const LeaseGrant& lease,
const CellularMigrationStagePrepared& prepared,
milliseconds timeout) {
const auto trace = server::decode_migration_trace(prepared.trace);
if (!trace || trace->format_version != 1 ||
prepared.key != RegionKey{trace->world, trace->request.destination.region} ||
if (!trace || prepared.key != RegionKey{trace->world, trace->request.destination.region} ||
lease.frame != trace->frame || prepared.ghost.sha256 == Sha256Digest{} ||
prepared.ghost.bytes == 0)
return std::unexpected(stage_failed(PublicationError::candidate));
@@ -521,8 +520,11 @@ constexpr auto commit_columns =
std::optional<CheckpointManifest>
migration_manifest(const CheckpointManifest& p, const Sha256Digest& digest, const Uuid& commit,
const LeaseGrant& lease, const Sha256Digest& build, VerifiedObject object) {
if (!supported(p) || p.cellular_versions != cellular_v10_versions || p.sequence == 0 ||
p.sequence == std::numeric_limits<std::uint64_t>::max() || lease.frame != p.frame)
if (!supported(p) ||
(p.cellular_versions != cellular_v10_versions &&
p.cellular_versions != cellular_v11_versions) ||
p.sequence == 0 || p.sequence == std::numeric_limits<std::uint64_t>::max() ||
lease.frame != p.frame)
return std::nullopt;
auto m = p;
m.commit = commit;