Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] fix pk table compact crash when light compaction is disable #45855

Merged
merged 3 commits into from
May 20, 2024

Conversation

luohaha
Copy link
Contributor

@luohaha luohaha commented May 19, 2024

Why I'm doing:

There are two issues:

  1. When BE config enable_light_pk_compaction_publish is false, std::vector<uint64_t> rssid_rowids in MergeEntry will be empty, and this code will cause crash:
rssid_rowids->insert(rssid_rowids->end(), top.rssid_rowids.begin() + start_offset,
                                             top.rssid_rowids.begin() + start_offset + nappend);

And real crash stack will be:

*** Aborted at 1716106255 (unix time) try "date -d @1716106255" if you are using GNU date ***
PC: @     0x7f5fdc14e410 __memcpy_ssse3_back
*** SIGSEGV (@0x0) received by PID 94048 (TID 0x7f5ee4b2f700) from PID 0; stack trace: ***
    @          0x67c0e42 google::(anonymous namespace)::FailureSignalHandler()
    @     0x7f5fdccfc630 (unknown)
    @     0x7f5fdc14e410 __memcpy_ssse3_back
    @          0x52572c6 std::vector<>::insert<>()
    @          0x525a664 starrocks::RowsetMergerImpl<>::get_next()
    @          0x525bd3b starrocks::RowsetMergerImpl<>::_do_merge_horizontally()
    @          0x525d073 starrocks::RowsetMergerImpl<>::_do_merge_vertically()
    @          0x525ed88 starrocks::RowsetMergerImpl<>::do_merge()
    @          0x5250161 starrocks::compaction_merge_rowsets()
    @          0x51265a7 starrocks::TabletUpdates::_do_compaction()
    @          0x5128622 starrocks::TabletUpdates::compaction_for_size_tiered()
    @          0x51290da starrocks::TabletUpdates::compaction()
    @          0x506c2ab starrocks::StorageEngine::_perform_update_compaction()
    @          0x4ff9174 starrocks::StorageEngine::_update_compaction_thread_callback()
    @          0x8bf3cb0 execute_native_thread_routine
    @     0x7f5fdccf4ea5 start_thread
    @     0x7f5fdc0f5b0d __clone
    @                0x0 (unknown)
  1. union_iterator doesn't support Status UnionIterator::do_get_next(Chunk* chunk, std::vector<uint64_t>* rssid_rowids).
    Which will lead to compaction failure like:
Exxx xxxx compaction_scheduler.cpp:341] Fail to compact tablet xxx. version=xxx txn_id=xxx cost=xxs : Not supported: Chunk* chunk, vector<uint64_t>* rssid_rowids) not supported
/build/starrocks/be/src/storage/merge_iterator.cpp:194 fill(i)
/build/starrocks/be/src/storage/merge_iterator.cpp:251 init()
/build/starrocks/be/src/storage/lake/tablet_reader.cpp:210 _collect_iter->get_next(chunk, source_masks, rssid_rowids)
/build/starrocks/be/src/storage/lake/vertical_compaction_task.cpp:74 compact_column_group(is_key, i, column_group_size, column_groups[i], writer, mask_buffer.get(), source_masks.get(), cancel_func)

What I'm doing:

Fix this crash.
Fix https://github.com/StarRocks/StarRocksTest/issues/7449

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.3
    • 3.2
    • 3.1
    • 3.0
    • 2.5

@luohaha luohaha requested a review from a team as a code owner May 19, 2024 11:55
@luohaha luohaha force-pushed the fix-light-compact-crash2 branch 2 times, most recently from b7babdd to 1c14a6b Compare May 19, 2024 14:41
Signed-off-by: luohaha <18810541851@163.com>
Signed-off-by: luohaha <18810541851@163.com>
sevev
sevev previously approved these changes May 20, 2024
wyb
wyb previously approved these changes May 20, 2024
@wyb wyb enabled auto-merge (squash) May 20, 2024 02:30
Signed-off-by: luohaha <18810541851@163.com>
@luohaha luohaha dismissed stale reviews from wyb and sevev via fbe0079 May 20, 2024 02:54
Copy link

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

[BE Incremental Coverage Report]

fail : 19 / 26 (73.08%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/storage/chunk_iterator.h 0 4 00.00% [154, 155, 157, 159]
🔵 be/src/storage/rowset_merger.cpp 9 11 81.82% [108, 369]
🔵 be/src/storage/union_iterator.cpp 10 11 90.91% [113]

@andyziye andyziye disabled auto-merge May 20, 2024 05:53
@andyziye andyziye merged commit cfdc27f into StarRocks:main May 20, 2024
45 of 46 checks passed
Copy link

@Mergifyio backport branch-3.3

@github-actions github-actions bot removed the 3.3 label May 20, 2024
Copy link

@Mergifyio backport branch-3.2

@github-actions github-actions bot removed the 3.2 label May 20, 2024
Copy link

@Mergifyio backport branch-3.1

@github-actions github-actions bot removed the 3.1 label May 20, 2024
Copy link
Contributor

mergify bot commented May 20, 2024

backport branch-3.3

✅ Backports have been created

Copy link
Contributor

mergify bot commented May 20, 2024

backport branch-3.2

✅ Backports have been created

Copy link
Contributor

mergify bot commented May 20, 2024

backport branch-3.1

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request May 20, 2024
…45855)

Signed-off-by: luohaha <18810541851@163.com>
(cherry picked from commit cfdc27f)
mergify bot pushed a commit that referenced this pull request May 20, 2024
…45855)

Signed-off-by: luohaha <18810541851@163.com>
(cherry picked from commit cfdc27f)
mergify bot pushed a commit that referenced this pull request May 20, 2024
…45855)

Signed-off-by: luohaha <18810541851@163.com>
(cherry picked from commit cfdc27f)
wanpengfei-git pushed a commit that referenced this pull request May 20, 2024
…(backport #45855) (#45907)

Co-authored-by: Yixin Luo <18810541851@163.com>
wanpengfei-git pushed a commit that referenced this pull request May 20, 2024
…(backport #45855) (#45908)

Co-authored-by: Yixin Luo <18810541851@163.com>
wanpengfei-git pushed a commit that referenced this pull request May 20, 2024
…(backport #45855) (#45909)

Co-authored-by: Yixin Luo <18810541851@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants