adapter: choose table append completion by group size#37627
Closed
def- wants to merge 1 commit into
Closed
Conversation
Txn-wal commits are durable before they are physically applied. Responding at commit reduces latency and prevents small group commits from starving, but allowing large single-table groups to continue before apply makes immediate reads pile up behind apply. Make append response timing explicit in StorageController and let group commit choose it. Respond at durable commit for multi-table writes and groups of up to four user writes. Wait for physical apply for larger single-table groups. This preserves pure-write throughput across concurrency levels while improving InsertAndSelectLimitWorkload by 7.7% at concurrency 16. Also update the stale pgtest expectation for unsupported COPY FORMAT BINARY to SQLSTATE 0A000.
def-
added a commit
that referenced
this pull request
Jul 14, 2026
…ply (#37443) (#37631) This reverts commit 6c590b0. I tried to fix performance regression the change introduced in other benchmarks in #37627, but failed. This feels safer. It's too bad we lose the ~2.5x improvement the PR had though. Nightly perf. run shows us that we do lose some performance from reverting: https://buildkite.com/materialize/nightly/builds/17318
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.
Motivation
Responding once a txn-wal commit is durable reduces table write latency, but allowing large single-table groups to continue before physical apply makes immediate reads pile up behind apply. The first version of this PR always waited for single-shard apply. That recovered the mixed read and write workload, but nightly testing exposed two new regressions:
Description
Make append response timing an explicit StorageController contract and let group commit choose the completion point. Multi-table writes and groups of up to four user writes respond once the txn-wal commit is durable. Larger single-table groups respond after physical apply. Bootstrap appends continue to wait for physical apply.
Also update the stray COPY pgtest expectation. Unsupported COPY FORMAT BINARY now correctly uses SQLSTATE 0A000 for feature not supported.
Verification
The response policy has a unit test, and the pgtest fixture covers both simple and extended query protocol paths.
Targeted optimized benchmarks against commit 75cdbb9 showed:
Follow-up to #37443.
Nightly benchmark: https://buildkite.com/materialize/nightly/builds/17312