Code review 2026-12-02 WP4: Cross-cluster, failover and central singletons #155
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
From the 2026-12-02 full code review (commits
28b6651a,f7e4f5b4: decisions accepted 2026-12-03).docs/plans/2026-12-02-full-code-review.mddocs/plans/2026-12-02-full-code-review-remediation.md→ WP4max(prev+1, nowMs), re-seeded on the standby→active transition. Reset interval counters on activation. The aggregator returnsAccepted=falseon a drop.SiteStreamServicesubscriptions withUnavailablewhile it isn'tSelfIsOldestUpfor its site role, and ends its streams on losing the active role.Status.Failure.SocketsHttpHandler.ConnectTimeouton the gRPC channels and treat a connect-phaseDeadlineExceededas failover-worthy.IOException/HttpRequestExceptionas transient.OUTCOME_UNKNOWNonly after the send.Parkedcan be re-opened, end to end. The site tracking store accepts a transition out ofParked: Retry clearsTerminalAtUtc, Discard writesDiscarded, and both emit telemetry. The central guard acceptsParked → Attempted/Delivered/Failed/Discardedwhen the incomingUpdatedAtUtcis newer. A separate reconcile sweep of parked rows was rejected because it adds a second path.Fixed on
main(pushed,922021c4). Plan:docs/plans/2026-12-02-full-code-review-remediation.md(see its Outcome section).All 11 tasks done, without touching
DeploymentService.Rig:
DRILL_MODE=activefailover drill PASS: takeover 25 s, Traefik 28 s, the killed node rejoins as standby.Unavailableand central streamed from site-a-b (114 live changes in 30 s).Migration:
AddKpiRollupBackfillState(persisted backfill marker). The first recorder start folds the whole raw window once.New option:
ScadaBridge:Communication:GrpcConnectTimeout, default 5 s.Commits:
f9af0139migration: AddKpiRollupBackfillState (KPI-1, WP4 task 4.10)e719e902fix(audit): purge/archive also cover partition 1 (rows before the first boundary) (AUD-6, WP4 task 4.11)2a41122afix(kpi): rollup backfill plans from its own persisted watermark, not the periodic fold's MAX (KPI-1, WP4 task 4.10)5c67559afix(sitecalls): Parked is re-openable end to end — operator Retry/Discard reach the site tracking row and central SiteCalls (SCA-1, WP4 task 4.9)4070f7effix(audit): reconciliation pulls every site node with a per-(site, node) cursor (AUD-1, WP4 task 4.8)c15bd210fix(delmia,inbound): a connect-phase failure (unreachable host, connect timeout) fails over to the next URL/peer instead of OUTCOME_UNKNOWN (DLM-1, WP4 task 4.7)11992075fix(notify,esg): classify dropped SMTP connections, OAuth2 token-endpoint outages and body-read connection loss as transient (NTF-2, ESG-1, WP4 task 4.6)5f7b850afix(outbox): persist a delivery outcome on its own token, not the shutdown token (NTF-1, WP4 task 4.5)f02fe9d6fix(comm): key site liveness on central receive time; gRPC connect timeout + connect-phase deadline failover (COMM-4, COMM-5, WP4 task 4.4)c1db7094fix(comm): fold post-snapshot debug events into the snapshot and fail fast on a snapshot-request failure (COMM-3, COMM-7, WP4 task 4.3)8a4b466afix(comm): site stream server refuses/ends subscriptions on a non-active node with Unavailable (COMM-2, WP4 task 4.2)34527374fix(health): wall-clock-anchored report sequence, nack stale reports, drain standby counters (COMM-1, COMM-6, WP4 task 4.1)Deploying to QA and DEV is tracked in #160. Closing.