Add M10.4b durable action records (schema v11)
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m47s
Foundation / checks (network) (push) Successful in 9m30s
Foundation / checks (client) (push) Successful in 12m19s
Foundation / checks (tsan) (push) Successful in 7m43s
Foundation / checks (checks) (push) Successful in 31m29s
Foundation / checks (postgres) (push) Successful in 36m39s
Foundation / postgres-tools (push) Successful in 19s
Foundation / image (push) Successful in 2m15s
Foundation / server-image (push) Successful in 20m37s

Each batch's actions are recorded in the same statement as its checkpoint: one
region_actions row per (world, account, action id) and the block in an append-only
table, compared on exact retries and resolution. The region host attaches actions to
the ticks they ride and reports acknowledgements and drops, keeping unknown-outcome
batches unresolved. Outcomes come from the durable record via ActionLedger, so
crashes before or after a commit, unknown publications and cross-region moves all
resolve to one answer; a repeated id keeps its first record instead of stalling a
region. ADR-0092.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-03 22:53:38 -04:00
co-authored by Claude Opus 5.5
parent e2f6208433
commit 69f3ad7cf8
32 changed files with 1289 additions and 75 deletions
@@ -0,0 +1,20 @@
#include "evo/server/postgres_action_ledger.hpp"
namespace evo::server {
std::expected<std::optional<network::ActionOutcome>, network::ActionLedgerError>
PostgresActionLedger::find(const network::AccountId& account, std::uint64_t action_id) {
const auto lease = lease_();
if (!lease)
return std::unexpected(network::ActionLedgerError::unavailable);
const auto found =
persistence::find_region_action(*db_, key_, *lease, account.bytes, action_id, timeout_);
if (!found.has_value())
return std::unexpected(network::ActionLedgerError::unavailable);
const auto& record = found.value();
if (!record.has_value())
return std::optional<network::ActionOutcome>{};
return std::optional<network::ActionOutcome>{
network::ActionOutcome{action_id, network::ActionResult::committed_no_effect,
record.value().tick, record.value().commit_sequence}};
}
} // namespace evo::server
+10 -4
View File
@@ -282,14 +282,14 @@ struct RegionSessions::Impl {
send(c, receipt);
// A duplicate of a final action: answer with the outcome as well.
if (receipt.status == network::AdmitStatus::duplicate)
if (const auto o = intents.query(c.session, {m->action_id});
if (const auto o = intents.query(c.session, {m->action_id}, admission());
o.result == network::ActionResult::committed_no_effect ||
o.result == network::ActionResult::not_committed)
send(c, o);
return;
}
if (const auto* m = std::get_if<network::ActionQuery>(&*decoded))
return send(c, intents.query(c.session, *m));
return send(c, intents.query(c.session, *m, admission()));
if (const auto* m = std::get_if<network::SessionClose>(&*decoded);
m && m->reason == SessionCloseReason::client_closed) {
close(c, SessionCloseReason::client_closed, now);
@@ -324,6 +324,7 @@ RegionSessions::create(RegionSessionsConfig config) {
auto intents = network::IntentAdmission::create(config.intents);
if (!intents)
return std::unexpected(RegionSessionsError::configuration);
intents->attach(config.actions);
auto endpoint = network::quic::Endpoint::serve(config.transport);
if (!endpoint)
return std::unexpected(RegionSessionsError::transport);
@@ -407,8 +408,13 @@ std::vector<network::CarriedAction> RegionSessions::carry(std::uint64_t tick) {
return impl_->intents.carry(tick);
}
void RegionSessions::committed(std::uint64_t end_tick, std::uint64_t commit_sequence) {
impl_->deliver(impl_->intents.committed(end_tick, commit_sequence));
void RegionSessions::committed(std::span<const network::CarriedAction> actions,
std::uint64_t commit_sequence) {
impl_->deliver(impl_->intents.committed(actions, commit_sequence));
}
void RegionSessions::dropped(std::span<const network::CarriedAction> actions, bool final) {
impl_->deliver(impl_->intents.dropped(actions, final));
}
void RegionSessions::shutdown(Clock::time_point now) {