[chery-pick](branch-2.1) Pick "[Fix](group commit) Fix group commit block queue mem estimate fault"#37379
Merged
dataroaring merged 1 commit intoapache:branch-2.1from Jul 7, 2024
Merged
Conversation
…pache#35314) ## Proposed changes Issue Number: close #xxx <!--Describe your changes.--> **Problem:** When `group commit=async_mode` and NULL data is imported into a `variant` type 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 using `add block`, and then blocks are retrieved from the queue using `get block`. To track memory usage during backpressure, we add the block size to the memory statistics during `add block` and subtract the block size from the memory statistics during `get block`. However, for `variant` types, during the `add block` write to WAL, serialization occurs, which can merge types (e.g., merging `int` and `bigint` into `bigint`), thereby changing the block size. This results in a discrepancy between the block size during `get block` and `add block`, causing memory statistics to overflow. **Solution:** Record the block size at the time of `add block` and use this recorded size during `get block` instead 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](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
Collaborator
Author
|
run buildall |
Contributor
|
clang-tidy review says "All clean, LGTM! 👍" |
|
TeamCity be ut coverage result: |
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.
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