fix(provision): rerun a finished cellular-v8 opening without the region lease

Every Argo sync reruns the provision hook while evo-region holds region 9's
lease. The cellular-v8 resume path acquired the lease before looking at the
head, so a finished bundle-13 region failed the hook ("photosynthesis
opening lease refused", exit 3) and the sync never reached the Deployment.
A head already at bundle 13 now needs no lease and reports
already-provisioned. The PostgreSQL suite reruns provisioning while a
running host holds the lease.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-20 18:22:44 -04:00
co-authored by Claude Opus 5.5
parent aa65209601
commit 60c034f066
2 changed files with 14 additions and 0 deletions
+9
View File
@@ -556,6 +556,15 @@ int finish_photosynthesis_opening(const Options& o, persistence::Postgres& db,
std::uint64_t frame, const persistence::Sha256Digest& build,
std::uint64_t light_pj) {
const auto& key = o.source.key;
// A finished opening needs no lease: a rerun (every Argo sync's provision hook) runs
// while the region server holds it, and must report the region rather than fail.
if (const auto current = persistence::load_region_checkpoint(db, key, timeout); current) {
const auto manifest = persistence::decode_manifest(current->manifest);
if (manifest && manifest->profile == persistence::CheckpointProfile::cellular_lives_v1 &&
manifest->frame == frame &&
manifest->cellular_versions == persistence::cellular_v13_versions)
return 0;
}
auto lease =
persistence::acquire_region_lease(db, key, build, std::chrono::seconds{60}, timeout);
if (!lease) {
+5
View File
@@ -745,6 +745,11 @@ void cellular_v8_provisioning_declares_light() {
auto next = CellularSessionBatchBuilder::create(*host->state(), host->committed()->head);
CHECK(next && next->append(host->state()->tick() + 1, baseline, {}));
CHECK(host->publish(next->batch(), next->actions(), next->mutation_actions()));
// Every Argo sync reruns the provision hook while the region server holds the lease.
const auto served =
provision_cellular(r, "9775", "cellular-v8", build, commit, "40,1,2000000,50000,20000,0,0",
code, "--motes", {"--light-pj", "40"});
CHECK(code == 0 && has(served, "already-provisioned world=9775 region=1"));
#endif
}