Expose cellular publication failure diagnostics
Foundation / checks (deploy) (push) Successful in 6s
Foundation / checks (ecs) (push) Successful in 1m58s
Foundation / checks (postgres) (push) Failing after 2m43s
Foundation / checks (checks) (push) Failing after 4m9s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (tsan) (push) Canceled after 4m24s
Foundation / checks (network) (push) Canceled after 4m28s
Foundation / checks (client) (push) Canceled after 4m34s

This commit is contained in:
dingo
2026-10-11 22:31:41 -04:00
parent d316911355
commit aa6e5579be
4 changed files with 44 additions and 8 deletions
+8 -5
View File
@@ -294,23 +294,23 @@ const HostStatus& CellularRegionHost::step() {
return status_;
}
std::expected<persistence::PublishedCellularBatch, CellularHostError>
std::expected<persistence::PublishedCellularBatch, CellularPublishFailure>
CellularRegionHost::publish(const CellularBatch& batch,
std::span<const CellularActionRecord> actions) {
const auto grant = authority_.grant();
if (!status_.ready || !state_ || !committed_ || !grant ||
!authority_.may_begin_commit(LeaseClock::now()))
return std::unexpected{CellularHostError::not_ready};
return std::unexpected{CellularPublishFailure{CellularHostError::not_ready}};
auto candidate = replay_cellular_batch(*state_, batch);
if (!candidate)
return std::unexpected{CellularHostError::invalid_batch};
return std::unexpected{CellularPublishFailure{CellularHostError::invalid_batch}};
auto trace = encode_cellular_batch(batch);
auto action_block =
encode_cellular_action_block(actions, batch.header.begin_tick, batch.header.end_tick);
const auto commit =
trace && action_block ? commit_id(*committed_, *trace, *action_block) : std::nullopt;
if (!commit)
return std::unexpected{CellularHostError::invalid_batch};
return std::unexpected{CellularPublishFailure{CellularHostError::invalid_batch}};
auto published = persistence::publish_cellular_batch(
*db_, *objects_, grant.value_or(persistence::LeaseGrant{}), *committed_, batch, **candidate,
*commit, config_.build, config_.lease.commit_timeout, {}, actions);
@@ -332,7 +332,10 @@ CellularRegionHost::publish(const CellularBatch& batch,
status_.ready = false;
++status_.fences;
}
return std::unexpected{CellularHostError::publication};
return std::unexpected{CellularPublishFailure{CellularHostError::publication,
published.error().kind,
published.error().store,
published.error().object}};
}
state_ = std::move(*candidate);
committed_ = published->committed;