Skip to content

test(proxy): cover transactional schema edge cases - #461

Open
tobyhede wants to merge 5 commits into
docs/bug-308-designfrom
test/bug-308-schema-lifecycle-coverage
Open

test(proxy): cover transactional schema edge cases#461
tobyhede wants to merge 5 commits into
docs/bug-308-designfrom
test/bug-308-schema-lifecycle-coverage

Conversation

@tobyhede

Copy link
Copy Markdown
Contributor

Acknowledgment

By submitting this pull request, I confirm that CipherStash can use, modify, copy, and redistribute this contribution, under the terms of CipherStash's choice.

Record the BUG-308 design for connection-local DDL visibility and authoritative schema publication. Define atomic committed snapshots, transaction overlays, savepoint behavior, protocol deferral, fail-closed reload handling, and the boundary of the standalone schema middleware.

Signed-off-by: James Sadler <james@cipherstash.com>
Publish schema and encryption metadata as one versioned snapshot, with connection-local overlays pinned for transactions and savepoint-aware rollback semantics.

Activate DDL only after backend success, defer pipelined statements behind in-flight DDL, and reload authoritative catalog state after the outermost commit using generation-safe coalescing.

Fail closed for unmodelled DDL, dependent simple-query batches, and publication failures. Add unit and TLS-backed regressions proving immediate cross-connection encryption and ciphertext at rest.

Signed-off-by: James Sadler <james@cipherstash.com>
Restrict the dependent post-DDL guard to schema changes that can alter encryption metadata, preserving pgx temporary-table setup batches while continuing to fail closed for encrypted DDL followed by mapped work.

Document every BUG-308 production module, type, and function. Expand the schema middleware module docs with its authority, atomicity, protocol-ordering, transaction, publication, and failure invariants plus current and intrinsic limitations.

Add focused regression coverage and verify the previously failing Go integration path against the rebuilt Proxy image.

Signed-off-by: James Sadler <james@cipherstash.com>
Normalize PostgreSQL identifiers in domain prediction, overlays, and savepoint matching. Fail closed when savepoint state cannot be reconciled, while accepting encryption-neutral ALTER TABLE operations and ignoring safe connection-local temporary tables.

Inject Flush after extended-protocol DDL Execute so clients can pipeline dependent Parse messages before a single Sync without deadlock. Track simple-query intents from the statements actually forwarded, including compatibility fallback paths, and centralize typed ReadyForQuery publication handling.

Remove the obsolete encryption configuration reloader, restore empty-configuration startup warnings in SchemaManager, and document ownership, correctness principles, trade-offs, and intrinsic limitations. Add unit, Rust database, and pgx SendBatch regressions for the review findings.

Signed-off-by: James Sadler <james@cipherstash.com>
@freshtonic
freshtonic force-pushed the docs/bug-308-design branch from 4d55098 to fa6bf25 Compare August 24, 2026 04:21
@tobyhede
tobyhede force-pushed the test/bug-308-schema-lifecycle-coverage branch 3 times, most recently from 31945d4 to 323785d Compare August 24, 2026 05:42
Signed-off-by: Toby Hede <toby@cipherstash.com>
@tobyhede
tobyhede force-pushed the test/bug-308-schema-lifecycle-coverage branch from 323785d to 4df987a Compare August 24, 2026 05:54
@freshtonic
freshtonic force-pushed the docs/bug-308-design branch from fa6bf25 to ded4814 Compare August 25, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants