Repository navigation
fix: finish topition inserts before create_topic writes watermarks - #929
Open
solace-aross wants to merge 1 commit into
Open
solace-aross wants to merge 1 commit into
solace-aross wants to merge 1 commit into
Conversation
The Postgres create_topic sent its topition and watermark inserts together and dropped the result streams unread. The watermark insert selects the topition row the other insert creates, so if it reached the server first it matched nothing and reported no error. Any error from either insert was dropped the same way, and COMMIT on an aborted transaction answers success, so create_topic could return Ok for a topic that was missing or had no watermark. Run the topition inserts to completion, then the watermark inserts, and fail if any insert does not affect exactly one row. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Andrea Ross <168456375+solace-aross@users.noreply.github.com>
solace-aross
requested review from
sgamelin,
shortishly and
solace-wkourlas
as code owners
October 9, 2026 21:57
This branch has not been deployed
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.
Postgres
create_topiccould return success for a topic that was missing or had no watermark row. This makes it wait for each insert and check the result.Why
pg::tests::race_concurrent_commit_and_abortfailed once in a merge queue run withUnknownTopicOrPartition, 0.22 s in, before the race it checks. Produce returns that error when the topition or the watermark row is missing.create_topicsent its topition and watermark inserts together and dropped the result streams unread. tokio-postgres returns fromquery_rawafter the bind, so an error from either insert was never seen.COMMITon a failed transaction answers success.create_topicthen returned the topic id with nothing committed.Changes
tx_prepare_query_raw, which had no other caller.Not confirmed
Verified
just fmtandcargo clippy --workspace --all-features --all-targets -- -D warningspass.cargo nextest run -p nisshi-storage-sql --all-features: 49 passed against a local Postgres 17.🤖 Generated with Claude Code