Skip to content

branch-4.0: [fix](compaction) Fix incorrect memory availability check in RowSourceBuffer during vertical compaction #63152 - #63231

Open
github-actions[bot] wants to merge 1 commit into
branch-4.0from
auto-pick-63152-branch-4.0
Open

branch-4.0: [fix](compaction) Fix incorrect memory availability check in RowSourceBuffer during vertical compaction #63152#63231
github-actions[bot] wants to merge 1 commit into
branch-4.0from
auto-pick-63152-branch-4.0

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Cherry-picked from #63152

@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@hello-stephen

Copy link
Copy Markdown
Contributor

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 100.00% (2/2) 🎉

Increment coverage report
Complete coverage report

CategoryCoverage
Function Coverage69.90% (24933/35667)
Line Coverage52.54% (261277/497285)
Region Coverage50.17% (216202/430914)
Branch Coverage51.34% (92669/180511)

@github-actionsgithub-actionsBot added the approved Indicates a PR has been approved by one committer. label Jun 24, 2026
@github-actions

Copy link
Copy Markdown
ContributorAuthor

PR approved by at least one committer and no changes requested.

@github-actions

Copy link
Copy Markdown
ContributorAuthor

PR approved by anyone and no changes requested.

…eBuffer during vertical compaction (#63152)
Exception Log:
```
thread_mem_tracker_mgr.h:248] alloc large memory: 4294967296, not in query or load, this is just a warning, not prevent memory alloc, stacktrace:
0# doris::ThreadMemTrackerMgr::consume(long, int)
1# Allocator<false, false, false, DefaultMemoryAllocator>::realloc_impl(void*, unsigned long, unsigned long, unsigned long)
2# void doris::vectorized::PODArrayBase<2ul, 4096ul, Allocator<false, false, false, DefaultMemoryAllocator>, 16ul, 15ul>::reserve_for_next_size<>()
3# doris::vectorized::RowSourcesBuffer::append(std::vector<doris::vectorized::RowSource, std::allocator<doris::vectorized::RowSource> > const&)
4# doris::vectorized::VerticalHeapMergeIterator::next_batch(doris::vectorized::Block*)
5# doris::vectorized::VerticalBlockReader::_direct_next_block(doris::vectorized::Block*, bool*)
6# doris::vectorized::VerticalBlockReader::next_block_with_aggregation(doris::vectorized::Block*, bool*)
7# doris::Merger::vertical_compact_one_group(std::shared_ptr<doris::BaseTablet>, doris::ReaderType, doris::TabletSchema const&, bool, std::vector<unsigned int, std::allocator<unsigned int> > const&, doris::vectorized::RowSourcesBuffer*, std::vector<std::shared_ptr<doris::RowsetReader>, std::allocator<std::shared_ptr<doris::RowsetReader> > > const&, doris::RowsetWriter*, long, doris::Merger::Statistics*, std::vector<unsigned int, std::allocator<unsigned int> >, long, doris::CompactionSampleInfo*)
8# doris::Merger::vertical_merge_rowsets(std::shared_ptr<doris::BaseTablet>, doris::ReaderType, doris::TabletSchema const&, std::vector<std::shared_ptr<doris::RowsetReader>, std::allocator<std::shared_ptr<doris::RowsetReader> > > const&, doris::RowsetWriter*, long, long, doris::Merger::Statistics*)
9# doris::Compaction::merge_input_rowsets()
10# doris::CloudCompactionMixin::execute_compact_impl(long)
11# doris::CloudCompactionMixin::execute_compact()
12# doris::CloudCumulativeCompaction::execute_compact()
13# std::_Function_handler<void (), doris::CloudStorageEngine::_submit_cumulative_compaction_task(std::shared_ptr<doris::CloudTablet> const&)::$_2>::_M_invoke(std::_Any_data const&)
14# doris::ThreadPool::dispatch_thread()
15# doris::Thread::supervise_thread(void*)
16# ?
17# ?
```
Reason: PaddedPODArray's `allocated_bytes` includes pad_left and
pad_right, which are NOT usable for storing elements.
Co-authored-by: liutang123 <liulijia1029@google.com>
@morrySnow
morrySnowforce-pushed the auto-pick-63152-branch-4.0 branch from da57965 to 9d09dd8CompareAugust 31, 2026 07:09
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@hello-stephen@morningman@liutang123