Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19108 +/- ##
============================================
+ Coverage 48.43% 48.46% +0.03%
Complexity 635 635
============================================
Files 5572 5573 +1
Lines 412012 412098 +86
Branches 54309 54329 +20
============================================
+ Hits 199556 199739 +183
+ Misses 212456 212359 -97 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
The failing SonarCloud quality gate (new_reliability_rating = 3) is not caused by this change: it comes from two bugs in recently merged pipe code and currently fails for every pull request. #19109 fixes them (its own SonarCloud gate passes); once it is merged, the gate here should pass on the next analysis. |
|
@jt2594838 @HTHou plz take a look |
A flush reserves memSize / seriesNumber * io_task_queue_size_for_flushing and takes it out of the MemTable budget. With fewer series than queue slots (default 10) the estimate exceeds the memtable itself: a memtable with 3 series reserved 3.3 times its size, more than the whole MemTable budget, so the reject threshold became negative and writes were rejected. The bounded IO queue can never hold more than the memtable, so the estimate is now capped at memSize when there are no more series than queue slots. With more series the estimate is unchanged.
20b3655 to
506a770
Compare
|




Description
MemTableFlushTask.syncFlushMemTable()reserves temporary memory for a flush and takes it out ofthe MemTable budget (
SystemInfo.reserveTemporaryMemoryForFlushing, since #18848; before thatapplyTemporaryMemoryForFlushingwith the same estimate):The bounded IO queue holds up to
io_task_queue_size_for_flushing(default 10) encoded series ofaverage size. With fewer series than queue slots the formula estimates more than the memtable
itself: a memtable with 3 series reserves 10/3 = 3.3 times its size. With a small MemTable budget
a single flush can then reserve more than the whole budget, so
FLUSH_THRESHOLDandREJECT_THRESHOLDbecome negative and the node rejects writes until the flush is done.Measured with the same code in a downstream fork (standalone DataNode, 147.9 MB MemTable budget),
writing to one device with 3 series (flushes of about 52 MB):
The queue can never hold more than the memtable, so the estimate is now capped at
memSizewhen there are no more series than queue slots; with more series it is unchanged.
The estimate is moved into a small static method
estimateTemporaryMemory(...)so that it canbe unit tested (
FlushMemoryEstimateTest).Tests
FlushMemoryEstimateTest(fails before the change: 173.3 MB estimated for a 52 MB memtablewith 3 series).
MemTableFlushTaskTest,TsFileProcessorTest,SystemInfoTest,DataRegionTest: 106 testspass;
spotless:checkpasses.🤖 Generated with Claude Code