Repository navigation
Read-only scope lists, 503 on statement timeouts, log read-model restores - #264
Merged
Merged
Conversation
…ores Read-only servers now restore the saved MeshMapper scope catalogues (a read-only step), so region scope lists are no longer empty. A statement that hits the pool's statement_timeout answers 503 with Retry-After on route evidence and the read-model pages instead of 500. Read-model trust logs when it comes back after a drop, and when repair runs drop it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three small fixes found during the dev-box soak of the 2.1 release candidate. No SQL, migration or result changes.
Read-only servers: region scope lists were empty
server.read_only: trueskippedmeshmapper.New, which only reads the saved scope catalogues and fills the in-memory scope store. Region handlers filter scope names through that store, so/scopes?region=and/stats/scopes?region=returned[](found in the dev-data timing run:region=golmgave[]where a writer gives 14 scopes). The restore now runs in both modes; themeshmapper.scopesrefresh task (writes, HTTP) stays writer-only. A read-only server's lists reflect the writer's catalogues as of its boot.TestReadOnlyBootWritesNothingPostgresnow seeds a saved SEA catalogue after the control boot and checks the read-only boot lists its scope for regionpnw, while still proving no table changed. With the old gate it fails with200 [].Statement timeouts answer 503, not 500
The API pools stop statements at 35 s (120 s on
api_slow). A statement that hit the limit returned a bare500; 2.0.7's pool had no limit, so those pages answered slowly instead. On the dev box a cold/routes/{iata}/{pathKey}/observations(7-day window) hit it.respondUnavailablenow maps SQLSTATE 57014 andcontext.DeadlineExceeded(notcontext.Canceled) to503, codedeadline_exceeded,Retry-After: 10. It applies to route evidence and the four read-model pages;beacon_api_unavailable_totalgainsreason="timeout". Other handlers still answer 500 on a timeout.Read-model trust logs restores
A drop logged one WARN and the restore logged nothing, so a log reader couldn't tell when region pages came back (seen in the soak's Postgres restart test).
Trust.updatenow logsread model trusted again: its pages are served from iton each restore after the first trust, andObserveRunlogsread model untrusted: repair runs fixed rows the writers missedonce when the drop policy trips (that drop was silent too).Checks
go build,go vet,gofmt,go test ./...withBEACON_TEST_POSTGRES_DSN(Postgres 16),go test -race ./internal/meshmapper ./internal/scopestore,govulncheck(0 affecting), swagger regenerated, plan policy unchanged.Docs: MeshCore-Beacon/beacon-docs (contract 503 row, read-only mode, trust log lines, metric reason).
Prod steps
None.