Add cellular replay trace and recovery lookup
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 41s
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 (client) (push) Canceled after 1m46s
Foundation / checks (network) (push) Canceled after 1m9s
Foundation / checks (ecs) (push) Canceled after 1m38s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 41s
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 (client) (push) Canceled after 1m46s
Foundation / checks (network) (push) Canceled after 1m9s
Foundation / checks (ecs) (push) Canceled after 1m38s
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
namespace evo::persistence {
|
||||
namespace {
|
||||
@@ -412,6 +413,29 @@ resolve_cellular_region_commit(Postgres& db, RegionKey key, const Uuid& commit,
|
||||
return ResolvedCommit{Resolution::committed, *head};
|
||||
}
|
||||
|
||||
std::expected<std::optional<std::vector<std::uint8_t>>, LeaseStoreFailure>
|
||||
load_cellular_publication_actions(Postgres& db, RegionKey key, const LeaseGrant& lease,
|
||||
const Uuid& commit, milliseconds timeout) {
|
||||
const std::array<std::string, 5> p{std::to_string(key.world), std::to_string(key.region),
|
||||
uuid_text(lease.holder), std::to_string(lease.epoch),
|
||||
uuid_text(commit)};
|
||||
auto rows = db.query(
|
||||
"SELECT encode(actions, 'hex') "
|
||||
"FROM evolution.load_cellular_publication_actions($1::evolution.u64, "
|
||||
"$2::evolution.u64, $3::uuid, $4::evolution.u64, $5::uuid)",
|
||||
p, timeout);
|
||||
if (!rows)
|
||||
return std::unexpected{classify(rows.error())};
|
||||
if (rows->empty())
|
||||
return std::optional<std::vector<std::uint8_t>>{};
|
||||
if (rows->size() != 1 || (*rows)[0].size() != 1 || !(*rows)[0][0])
|
||||
return std::unexpected{malformed(false)};
|
||||
auto actions = unhex_bytes(*(*rows)[0][0]);
|
||||
if (!actions)
|
||||
return std::unexpected{malformed(false)};
|
||||
return std::optional<std::vector<std::uint8_t>>{std::move(*actions)};
|
||||
}
|
||||
|
||||
std::expected<std::optional<CommittedAction>, LeaseStoreFailure>
|
||||
find_region_action(Postgres& db, RegionKey key, const LeaseGrant& lease, const Uuid& account,
|
||||
std::uint64_t action_id, milliseconds timeout) {
|
||||
|
||||
Reference in New Issue
Block a user