Exercise client follow for life owner redirects
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 6s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 39s
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 47s
Foundation / checks (tsan) (push) Canceled after 24s
Foundation / checks (ecs) (push) Canceled after 59s

This commit is contained in:
dingo
2026-10-11 01:36:04 -04:00
parent e6ba9bd1a9
commit bf87aa4de4
4 changed files with 46 additions and 9 deletions
+7 -2
View File
@@ -143,13 +143,18 @@ Local checks do not close ADR-0097's reference-worker qualification.
then closes as moved. Cellular startup requires a route catalog containing then closes as moved. Cellular startup requires a route catalog containing
this region; malformed, duplicate, unavailable, and missing-owner routes fail this region; malformed, duplicate, unavailable, and missing-owner routes fail
closed. QUIC tests cover redirect-before-claim and missing-route refusal. closed. QUIC tests cover redirect-before-claim and missing-route refusal.
PostgreSQL and migration CI, client switching, and process-kill qualification PostgreSQL and migration CI and process-kill qualification remain pending.
remain pending. Do not claim 11.2 complete until redirect/restart gates pass. Client switching is covered by 11.2d-7d below. Do not claim 11.2 complete
until redirect/restart gates pass.
- 11.2d-7c qualification: the PostgreSQL-backed region-session process test now - 11.2d-7c qualification: the PostgreSQL-backed region-session process test now
creates a life in region 35, logs the account into region 36 with an explicit creates a life in region 35, logs the account into region 36 with an explicit
two-region catalog, checks the redirect and unchanged account-control owner, two-region catalog, checks the redirect and unchanged account-control owner,
kills region 35, restarts it, verifies the same life, and checks routing again. kills region 35, restarts it, verifies the same life, and checks routing again.
Execution remains pending Linux/PostgreSQL CI. Execution remains pending Linux/PostgreSQL CI.
- 11.2d-7d client follow: the two-region remote-client test now gives its
account an active life owner in region 2 and checks that the redirect chooses
a region-2 grant without claiming control in region 1. Runtime execution
remains pending CI.
No deployed world has been provisioned or changed by this work. No deployed world has been provisioned or changed by this work.
+10
View File
@@ -6587,3 +6587,13 @@ The process-test source cannot be syntax-compiled locally because the Windows
toolchain lacks POSIX `poll.h`, which its existing process fixture requires. toolchain lacks POSIX `poll.h`, which its existing process fixture requires.
The app bridge header compile, formatting check, and `git diff --check` passed; The app bridge header compile, formatting check, and `git diff --check` passed;
the PostgreSQL process test has not run and requires CI confirmation. the PostgreSQL process test has not run and requires CI confirmation.
## 2026-10-11 — M11.2d-7d client follows life-owner redirect (pending CI)
Extended `tests/client_remote_session.cpp` and its two-region fake world so the
second login is redirected by the new durable-life-owner hook before region 1
claims control. The remote client follows region 2, selects its grant from the
bundle, and establishes there. Claim counters assert that region 1 did not take
control. GCC 13.2 strict-warning syntax compilation and Visual Studio LLVM
`clang-format` passed; the test binary has not run. CI execution remains
required.
+20 -6
View File
@@ -390,6 +390,11 @@ void crossing_regions(const Files& f) {
c.neighbours.push_back( c.neighbours.push_back(
{{neighbour, "localhost:" + std::to_string(neighbour_port), std::string{name}}, {{neighbour, "localhost:" + std::to_string(neighbour_port), std::string{name}},
area(neighbour == 1 ? 0 : 10 * m)}); area(neighbour == 1 ? 0 : 10 * m)});
c.life_owner_routes = {
server::LifeOwnerRoute{
RegionAddress{id, "localhost:" + std::to_string(port), std::string{name}}},
server::LifeOwnerRoute{RegionAddress{
neighbour, "localhost:" + std::to_string(neighbour_port), std::string{name}}}};
c.ghost_poll = std::chrono::milliseconds{20}; c.ghost_poll = std::chrono::milliseconds{20};
auto made = server::RegionSessions::create(std::move(c)); auto made = server::RegionSessions::create(std::move(c));
CHECK(made.has_value()); CHECK(made.has_value());
@@ -398,14 +403,18 @@ void crossing_regions(const Files& f) {
(*made)->set_default_interest({(x0 / m) + 5, 5, 0, 7}); (*made)->set_default_interest({(x0 / m) + 5, 5, 0, 7});
return std::move(*made); return std::move(*made);
}; };
// Region 2 listens on a port found by binding a throwaway region first. // Reserve both ports using throwaway listeners so each world route is complete.
std::uint16_t port2 = 0; std::uint16_t port1 = 0, port2 = 0;
{ {
auto probe = make(2, db2, key2, *key1, 1, 1, 0); auto probe = make(1, db1, key1, *key2, 2, 1, 0);
port1 = probe->port();
}
{
auto probe = make(2, db2, key2, *key1, 1, port1, 0);
port2 = probe->port(); port2 = probe->port();
} }
auto r1 = make(1, db1, key1, *key2, 2, port2, 0); auto r1 = make(1, db1, key1, *key2, 2, port2, port1);
auto r2 = make(2, db2, key2, *key1, 1, r1->port(), port2); auto r2 = make(2, db2, key2, *key1, 1, port1, port2);
std::uint64_t tick = 100; std::uint64_t tick = 100;
const auto grants = [&](const AccountId& who, std::uint64_t first) { const auto grants = [&](const AccountId& who, std::uint64_t first) {
std::vector<WireGrant> out; std::vector<WireGrant> out;
@@ -465,13 +474,18 @@ void crossing_regions(const Files& f) {
world.probes.at(dana).owner == 2 && s.status().marker_x_mm >= 10'000); world.probes.at(dana).owner == 2 && s.status().marker_x_mm >= 10'000);
a.intention.move_x = 0; a.intention.move_x = 0;
// A second client with a newer bundle logs in at region 1 and is redirected to region 2, // A second client with a newer bundle logs in at region 1 and is redirected to region 2,
// where it takes over (the first is superseded). // where it takes over (the first is superseded). The active life owner lookup must
// redirect before region 1's durable control claim.
world.life_owners[dana] = 2;
const auto region1_claims = db1.claims;
const auto region2_claims = db2.claims;
Client b; Client b;
CHECK(b.host.connect(RemoteSession::open(material(grants(dana, 20))))); CHECK(b.host.connect(RemoteSession::open(material(grants(dana, 20)))));
auto& t = *b.host.session(); auto& t = *b.host.session();
CHECK( CHECK(
pump({&a, &b}, [&] { return t.status().region == 2 && t.status().phase == "connected"; })); pump({&a, &b}, [&] { return t.status().region == 2 && t.status().phase == "connected"; }));
CHECK(a.phase() == LaunchPhase::failed && world.probes.at(dana).owner == 2); CHECK(a.phase() == LaunchPhase::failed && world.probes.at(dana).owner == 2);
CHECK(db1.claims == region1_claims && db2.claims == region2_claims + 1);
} }
} // namespace } // namespace
+9 -1
View File
@@ -36,6 +36,7 @@ struct WorldDb {
State state{}; State state{};
}; };
std::map<AccountId, Probe> probes; std::map<AccountId, Probe> probes;
std::map<AccountId, std::uint64_t> life_owners;
std::map<TransferId, Transfer> transfers; std::map<TransferId, Transfer> transfers;
bool all_overdue{}; // overdue() reports every open transfer (a restarted source's view). bool all_overdue{}; // overdue() reports every open transfer (a restarted source's view).
std::uint64_t overdue_reads{}; std::uint64_t overdue_reads{};
@@ -114,8 +115,15 @@ struct RegionDb final : server::ProbeLedger, HandoffLedger, ControlLedger {
} }
std::expected<ControlLease, ControlLedgerError> claim(const AccountId&, std::uint64_t, std::expected<ControlLease, ControlLedgerError> claim(const AccountId&, std::uint64_t,
std::uint64_t) override { std::uint64_t) override {
++claims;
return ControlLease{++control, {}, std::chrono::milliseconds{20000}}; return ControlLease{++control, {}, std::chrono::milliseconds{20000}};
} }
std::expected<std::optional<std::uint64_t>, ControlLedgerError>
primitive_life_owner(const AccountId& account) override {
const auto found = world->life_owners.find(account);
return found == world->life_owners.end() ? std::optional<std::uint64_t>{}
: std::optional{found->second};
}
std::expected<std::chrono::milliseconds, ControlLedgerError> renew(const AccountId&, std::expected<std::chrono::milliseconds, ControlLedgerError> renew(const AccountId&,
std::uint64_t) override { std::uint64_t) override {
return std::chrono::milliseconds{20000}; return std::chrono::milliseconds{20000};
@@ -125,6 +133,6 @@ struct RegionDb final : server::ProbeLedger, HandoffLedger, ControlLedger {
} }
WorldDb* world; WorldDb* world;
std::uint64_t region; std::uint64_t region;
std::uint64_t control{}, saves{}, releases{}; std::uint64_t control{}, claims{}, saves{}, releases{};
}; };
} // namespace evo::test } // namespace evo::test