fix(session): tag rules 10/11 session batches with the inheritance trace format
Foundation / checks (checks) (push) Successful in 1h42m20s
Foundation / checks (client) (push) Successful in 22m8s
Foundation / checks (deploy) (push) Successful in 5m2s
Foundation / checks (ecs) (push) Successful in 2m22s
Foundation / checks (network) (push) Successful in 20m56s
Foundation / checks (tsan) (push) Successful in 46m50s
Foundation / checks (postgres) (push) Successful in 1h2m47s
Foundation / postgres-tools (push) Successful in 27s
Foundation / server-image (push) Successful in 3m42s
Foundation / image (push) Successful in 7m2s
Foundation / checks (checks) (push) Successful in 1h42m20s
Foundation / checks (client) (push) Successful in 22m8s
Foundation / checks (deploy) (push) Successful in 5m2s
Foundation / checks (ecs) (push) Successful in 2m22s
Foundation / checks (network) (push) Successful in 20m56s
Foundation / checks (tsan) (push) Successful in 46m50s
Foundation / checks (postgres) (push) Successful in 1h2m47s
Foundation / postgres-tools (push) Successful in 27s
Foundation / server-image (push) Successful in 3m42s
Foundation / image (push) Successful in 7m2s
CellularSessionBatchBuilder left every batch at cellular_batch_format, but replay accepts only the inheritance format on owners that retain offspring plans (format >= 8, rules 10 and 11). On DEV region 9 (bundle 13) every player tick, including a queued birth, was refused at publication as an invalid batch, so births stayed pending forever. The builder now declares the same format the unattended interval path already uses. The PostgreSQL suite provisions cellular-v8 and drives a birth and an ordinary tick through the host and session builder, as evo-server does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+2
-1
@@ -338,7 +338,8 @@ if(EVO_BUILD_POSTGRES)
|
||||
# M10.8d: two evo-server processes handing probes over (ADR-0096).
|
||||
target_sources(evo-postgres-tests PRIVATE tests/region_m10_session_tests.cpp
|
||||
tests/region_handoff_process_tests.cpp)
|
||||
target_link_libraries(evo-postgres-tests PRIVATE evo_session_client)
|
||||
target_link_libraries(evo-postgres-tests PRIVATE evo_session_client
|
||||
evo_cellular_session_adapter)
|
||||
target_compile_definitions(evo-postgres-tests PRIVATE EVO_POSTGRES_M10=1)
|
||||
add_dependencies(evo-postgres-tests evo-session-probe evo-load)
|
||||
endif()
|
||||
|
||||
@@ -12,7 +12,7 @@ spec:
|
||||
env:
|
||||
- {name: REGION_SESSION, value: "dev"}
|
||||
- {name: REGION_SESSION_LISTEN, value: "0.0.0.0:7400"}
|
||||
- {name: REGION_SESSION_WINDOW, value: "dev-20261020T113649-63c77b5a:1792510609"}
|
||||
- {name: REGION_SESSION_WINDOW, value: "dev-20261020T152057-af0e1753:1792524057"}
|
||||
- {name: REGION_M10_MAX_GRANT_LIFETIME, value: "14400"}
|
||||
ports:
|
||||
# QUIC (ADR-0090): UDP only; nothing listens on TCP 7400.
|
||||
|
||||
@@ -163,6 +163,11 @@ CellularSessionBatchBuilder::create(const CellularLives& committed_state,
|
||||
committed_state.frame(), committed_head.commit,
|
||||
committed_head.digest, committed_state.tick(),
|
||||
committed_state.tick()};
|
||||
// Owners that retain offspring plans (rules 10 and 11) replay only the inheritance
|
||||
// trace format, exactly as their unattended intervals are written.
|
||||
if (committed_state.format_version() >= cellular_lives_inheritance_format &&
|
||||
cellular_retained_plans(committed_state.rules_version()))
|
||||
builder.batch_.format_version = cellular_batch_inheritance_format;
|
||||
return builder;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,13 @@
|
||||
// the object volume's free-space reserve, a genuinely failing write, the
|
||||
// check-store probe (retention across runs, missing-volume refusal, privilege
|
||||
// boundary) and a server whose volume is full. Run by tools/ci/postgres-check.sh.
|
||||
#include "evo/persistence/account_control_store.hpp"
|
||||
#include "evo/persistence/checkpoint_store.hpp"
|
||||
#include "evo/persistence/region_checkpoint.hpp"
|
||||
#ifdef EVO_POSTGRES_M10
|
||||
#include "evo/server/cellular_region_host.hpp"
|
||||
#include "evo/server/cellular_session_batch.hpp"
|
||||
#endif
|
||||
#include "evo/server/lifecycle/primitive_lives.hpp"
|
||||
#include "fixtures/server_process.hpp"
|
||||
#include <algorithm>
|
||||
@@ -651,6 +656,78 @@ void cellular_v8_provisioning_declares_light() {
|
||||
const auto manifest = decode_manifest(head->manifest);
|
||||
CHECK(manifest && manifest->cellular_versions == cellular_v13_versions &&
|
||||
manifest->history_profile == cellular_revision_history_profile);
|
||||
#ifdef EVO_POSTGRES_M10
|
||||
// A player's birth on the provisioned head takes the live server's path: host
|
||||
// reservation, session batch builder, host publication.
|
||||
using namespace evo::server;
|
||||
const auto connect = [&]() -> std::expected<std::unique_ptr<Postgres>, PgFailure> {
|
||||
return Postgres::connect({env("PGHOST"),
|
||||
{},
|
||||
env("PGPORT"),
|
||||
env("PGDATABASE"),
|
||||
env("EVO_PG_RUNTIME_USER"),
|
||||
{},
|
||||
{}},
|
||||
5s);
|
||||
};
|
||||
CHECK(db->query("INSERT INTO evolution.life_allocators VALUES(9775,1000)", {}, 5s));
|
||||
Sha256Digest digest{};
|
||||
digest.fill(0xEE);
|
||||
auto objects = FilesystemObjectStore::open(r.root, r.key, max_cellular_lives_bytes);
|
||||
CHECK(objects);
|
||||
auto made =
|
||||
CellularRegionHost::create({r.key, 9, {}, digest, {digest}}, connect, std::move(*objects));
|
||||
CHECK(made);
|
||||
auto host = std::move(*made);
|
||||
CHECK(host->step().ready && host->state());
|
||||
auto runtime = connect();
|
||||
CHECK(runtime);
|
||||
Uuid account{};
|
||||
account[0] = 0x8E;
|
||||
account.back() = 0x13;
|
||||
const auto control =
|
||||
claim_account_control(**runtime, r.key, *host->authority(), account, 1, 1, 20'000ms, 5s);
|
||||
CHECK(control);
|
||||
const auto requested = host->create_primitive_life(account, control->generation, 5);
|
||||
CHECK(requested.result == evo::network::PrimitiveLifeResult::pending &&
|
||||
host->queued_births().size() == 1);
|
||||
const std::vector births(host->queued_births().begin(), host->queued_births().end());
|
||||
auto builder = CellularSessionBatchBuilder::create(*host->state(), host->committed()->head);
|
||||
CHECK(builder);
|
||||
const auto appended =
|
||||
builder->append_with_birth_refusals(host->state()->tick() + 1, {}, {}, births, {});
|
||||
if (!appended)
|
||||
throw std::runtime_error(
|
||||
"bundle 13 birth append failed: " + std::to_string(static_cast<int>(appended.error())) +
|
||||
" lives " +
|
||||
std::to_string(
|
||||
builder->last_lives_error() ? static_cast<int>(*builder->last_lives_error()) : -1));
|
||||
CHECK(builder->refused_births().empty());
|
||||
// Rules 11 replays only the inheritance trace format; the builder must declare it.
|
||||
CHECK(builder->batch().format_version == cellular_batch_inheritance_format);
|
||||
const auto published =
|
||||
host->publish(builder->batch(), builder->actions(), builder->mutation_actions());
|
||||
if (!published) {
|
||||
const auto& failure = published.error();
|
||||
std::string message = "bundle 13 birth publish failed: kind " +
|
||||
std::to_string(static_cast<int>(failure.kind));
|
||||
if (failure.publication)
|
||||
message += " publication " + std::to_string(static_cast<int>(*failure.publication));
|
||||
if (failure.store && failure.store->cause.sqlstate[0] != '\0')
|
||||
message += " sqlstate " + std::string(failure.store->cause.sqlstate.data(), 5);
|
||||
throw std::runtime_error(message);
|
||||
}
|
||||
CHECK(host->query_primitive_life(account, control->generation, 5).result ==
|
||||
evo::network::PrimitiveLifeResult::born);
|
||||
// The player's next ordinary session tick publishes too.
|
||||
std::vector<CellularLifeIntent> baseline;
|
||||
for (const auto& life : host->state()->lives())
|
||||
baseline.push_back({life.identity.life, {}});
|
||||
std::ranges::sort(baseline, {}, &CellularLifeIntent::life_id);
|
||||
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()));
|
||||
#endif
|
||||
}
|
||||
|
||||
void cellular_provisioning_survives_a_build_promotion() {
|
||||
|
||||
Reference in New Issue
Block a user