[chery-pick](branch-2.1) Pick "[Fix](group commit) Fix group commit block queue mem estimate fault" #37379
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.
Pick [Fix](group commit) Fix group commit block queue mem estimate faule #35314
Proposed changes
Issue Number: close #xxx
Problem: When
group commit=async_modeand NULL data is imported into avarianttype column, it causes incorrect memory statistics for group commit backpressure, leading to a stuck issue. Cause: In group commit mode, blocks are first added to a queue in batches usingadd block, and then blocks are retrieved from the queue usingget block. To track memory usage during backpressure, we add the block size to the memory statistics duringadd blockand subtract the block size from the memory statistics duringget block. However, forvarianttypes, during theadd blockwrite to WAL, serialization occurs, which can merge types (e.g., mergingintandbigintintobigint), thereby changing the block size. This results in a discrepancy between the block size duringget blockandadd block, causing memory statistics to overflow.Solution: Record the block size at the time of
add blockand use this recorded size duringget blockinstead of the actual block size. This ensures consistency in the memory addition and subtraction.Further comments
If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...
Proposed changes
Issue Number: close #xxx