test: add reader, connection-loss and failover checks to the AWS-boundary tier - #75
test: add reader, connection-loss and failover checks to the AWS-boundary tier#75Kiran01bm wants to merge 2 commits into
Conversation
…dary tier Bumps the pinned Ministack image so the tier runs against real hot-standby readers and the FailoverDBCluster API. Failover is asserted at the metadata level only; data-plane promotion is not exercised yet.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
🤖 Adversarial correctness review, requested by Armand and performed by his agent. Reviewed at head Verdict: the reader and failover subtests prove what they claim; Findings1.
So the subtest passes if the DDL fails for any reason at all — and one is sitting right there: 2. The stop/start subtest mutates cluster-wide state the next subtest depends on, and only waits for half of it. After 3. 4. (nits) The new assertions hardcode Action items
Verified (tried to break, couldn't)
This review was generated by Claude Code (claude-opus-5). |
|
🤖 Two-lens product review (OSS adoption ease, then integration as an engine), same head Lens 1 — someone finds this repo and runs it against their own databaseThe tier gets meaningfully more honest with this change. The three shapes it now pins — reader endpoint, connection loss, failover — are exactly the ones an operator hits first, and One gap for that reader: Lens 2 — how a caller like SchemaBot consumes thisThe reader subtest documents a seam that points the wrong way for a caller. It proves that catalog-only preflight succeeds against a hot standby and the refusal only arrives when the executor attempts a write. For anything driving pg-sprite programmatically that is the worst available ordering: plan and preflight report a green, the operator approves, and the change dies mid-apply as a generic
This review was generated by Claude Code (claude-opus-5). |
aparajon
left a comment
There was a problem hiding this comment.
🤖 Approving on Armand's behalf after the adversarial correctness review above. Finding 1 is worth doing before this becomes a test someone trusts — flagging it, not gating on it.
This stamp was left by Claude Code (claude-opus-5).
The connection-loss subtest accepted any DDL failure, including a query_canceled from its own one-minute statement_timeout racing the five-minute payload; it now requires the backend's shutdown SQLSTATE or a connection-level error, sets the session timeout above the payload so that race cannot exist, and proves the interrupted relation left no trace. The restart waits for both members so the failover subtest never inherits a half-restarted cluster.
|
🤖 Review response — created by Kiran's code review agent (Amp, Claude Opus 4.5) — pull/75, follow-up commit Source: review comment 5533058628 (correctness) and 5533059002 (product, two lenses) at head
|
Add read-only reader, connection-loss and metadata-failover checks to the AWS-boundary test tier, and move it to ministack
1.5.6-full.Why
The AWS-boundary tier proved only that pg-sprite could reach an Aurora-shaped endpoint. It did not assert how the executor behaves when the endpoint is a read-only replica, when the connection drops mid-change, or when the cluster fails over — the three shapes an operator actually hits. Each of those already has a defined outcome in the code (terminal on SQLSTATE 25006, terminal
execution-failedon connection loss) but nothing pinned it.What
internal/testutil/ministack.go: image1.4.15-full→1.5.6-full; cluster replication enabled so the cluster has a real hot-standby reader (a second member, so provisioning takes longer); onememberHostAddrhelper resolves the host-published port of either member.internal/testutil/ministack_integration_test.go:ReaderIsReadOnly— catalog preflight succeeds on the standby, a write fails with SQLSTATE 25006, and the connection layer treats it as terminal.ConnectionLossDuringSchemaChange— stopping compute interrupts an in-flight DDL; the test pins the cause (backendadmin_shutdown/crash_shutdownor a connection-level error — never the session's ownstatement_timeout), asserts the terminalexecution-failedoutcome, waits for every member to return, and proves the interrupted relation left no catalog trace.MetadataFailoverKeepsWriterSession—FailoverDBClusterflips the API-visible writer while an established writer transaction stays usable; the emulator does not promote the standby at the data plane and the test claims nothing more.docs/testing.md: describe the subtests, what each guarantees, the replication-driven provisioning cost, and the ordering constraints.Before / after