Repository navigation
Conversation
jt2594838
approved these changes
Oct 22, 2026
jt2594838
deleted the
fix/flush-selected-memtables-before-admission-wait
branch
October 22, 2026 08:52
Caideyipi
added a commit
that referenced
this pull request
Oct 22, 2026
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.
Description
A rejected writer can hold its DataRegion write lock while waiting for memory from a larger, already-selected MemTable in the same region. The asynchronous flush submitter needs that same lock, so the selected flush can remain blocked until the write times out with 606.
Let the waiting writer submit other already-marked MemTables in its own region through the existing flush entry point. Keep the current processor out of this path because it still owns the pending write and memory reservations. This keeps the existing largest-MemTable selection, rejection thresholds, flush policy, and duplicate-task checks; it does not mark additional MemTables or force the current small MemTable into a new file.
Add real row and tablet regressions that retain the region lock throughout admission, cross a primitive-array allocation boundary, and verify that only the selected processor flushes. Both smaller MemTables are reused, reservations are settled, and all 515 timestamp/value pairs remain readable from exactly three TsFiles after closing.
Validation
TsFileProcessorTestandSystemInfoTest: 40 tests passed, covering admission rollback, hard-limit rejection, largest-MemTable selection, and duplicate submission prevention.DataRegionTestrun was not clean on this Windows host: a WAL direct-buffer allocation failed withOutOfMemoryError, followed by file-cleanup errors and a timed-flush MemTable-count assertion. The new regressions passed in that run and also passed in isolation. No cluster-scale throughput benchmark was run.This PR has: