Add M10.4c evo-server QUIC listener and headless session client
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m46s
Foundation / checks (postgres) (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 0s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (checks) (push) Canceled after 3m44s
Foundation / checks (client) (push) Canceled after 3m49s
Foundation / checks (network) (push) Canceled after 1m59s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m46s
Foundation / checks (postgres) (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 0s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (checks) (push) Canceled after 3m44s
Foundation / checks (client) (push) Canceled after 3m49s
Foundation / checks (network) (push) Canceled after 1m59s
evo-server gains an opt-in M10 listener (--m10-*, QUIC builds only): RegionSessions with the PostgreSQL control and action ledgers on their own connection under the host's lease, carried actions submitted to the host and its acknowledgements and drops turned into outcomes. evo-session-probe is a dev-only headless client. Real process tests cover intentions, durable action outcomes, SIGKILL before and after an action's commit, duplicate retries and the probe. The simulated watermark now reaches every session every tick, so clients always know the server tick. ADR-0092. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,10 +6,18 @@ PostgresActionLedger::find(const network::AccountId& account, std::uint64_t acti
|
||||
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())
|
||||
auto* db = db_->get();
|
||||
if (!db)
|
||||
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()) {
|
||||
const auto kind = found.error().kind;
|
||||
if (kind == persistence::LeaseStoreError::store ||
|
||||
kind == persistence::LeaseStoreError::unknown)
|
||||
db_->broken(); // Reconnect next time.
|
||||
return std::unexpected(network::ActionLedgerError::unavailable);
|
||||
}
|
||||
const auto& record = found.value();
|
||||
if (!record.has_value())
|
||||
return std::optional<network::ActionOutcome>{};
|
||||
|
||||
@@ -20,6 +20,11 @@ ControlLedgerError ledger_error(ControlStoreError e) {
|
||||
persistence::Uuid uuid(const network::AccountId& account) {
|
||||
return account.bytes;
|
||||
}
|
||||
// A store failure leaves the connection in an unknown state: reconnect next time.
|
||||
void note(PgSlot& slot, ControlStoreError e) {
|
||||
if (e == ControlStoreError::store || e == ControlStoreError::unknown)
|
||||
slot.broken();
|
||||
}
|
||||
} // namespace
|
||||
|
||||
std::expected<network::ControlLease, ControlLedgerError>
|
||||
@@ -28,10 +33,15 @@ PostgresControlLedger::claim(const network::AccountId& account, std::uint64_t se
|
||||
const auto lease = lease_();
|
||||
if (!lease)
|
||||
return std::unexpected(ControlLedgerError::fenced);
|
||||
const auto claimed = persistence::claim_account_control(*db_, key_, *lease, uuid(account),
|
||||
auto* db = db_->get();
|
||||
if (!db)
|
||||
return std::unexpected(ControlLedgerError::unavailable);
|
||||
const auto claimed = persistence::claim_account_control(*db, key_, *lease, uuid(account),
|
||||
serial, session, duration_, timeout_);
|
||||
if (!claimed)
|
||||
if (!claimed) {
|
||||
note(*db_, claimed.error().kind);
|
||||
return std::unexpected(ledger_error(claimed.error().kind));
|
||||
}
|
||||
return network::ControlLease{claimed->generation, claimed->wait, claimed->granted};
|
||||
}
|
||||
|
||||
@@ -40,18 +50,29 @@ PostgresControlLedger::renew(const network::AccountId& account, std::uint64_t ge
|
||||
const auto lease = lease_();
|
||||
if (!lease)
|
||||
return std::unexpected(ControlLedgerError::fenced);
|
||||
const auto renewed = persistence::renew_account_control(*db_, key_, *lease, uuid(account),
|
||||
auto* db = db_->get();
|
||||
if (!db)
|
||||
return std::unexpected(ControlLedgerError::unavailable);
|
||||
const auto renewed = persistence::renew_account_control(*db, key_, *lease, uuid(account),
|
||||
generation, duration_, timeout_);
|
||||
if (!renewed)
|
||||
if (!renewed) {
|
||||
note(*db_, renewed.error().kind);
|
||||
return std::unexpected(ledger_error(renewed.error().kind));
|
||||
}
|
||||
return *renewed;
|
||||
}
|
||||
|
||||
void PostgresControlLedger::release(const network::AccountId& account, std::uint64_t generation) {
|
||||
// Best effort: an unreleased control simply expires; a fenced one already moved on.
|
||||
if (const auto lease = lease_())
|
||||
(void)persistence::release_account_control(*db_, key_, *lease, uuid(account), generation,
|
||||
timeout_)
|
||||
.has_value();
|
||||
const auto lease = lease_();
|
||||
if (!lease)
|
||||
return;
|
||||
auto* db = db_->get();
|
||||
if (!db)
|
||||
return;
|
||||
if (const auto released = persistence::release_account_control(*db, key_, *lease, uuid(account),
|
||||
generation, timeout_);
|
||||
!released)
|
||||
note(*db_, released.error().kind);
|
||||
}
|
||||
} // namespace evo::server
|
||||
|
||||
Reference in New Issue
Block a user