-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 large binary column overflow when column writer append #36281
Merged
Conversation
This file contains 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
imay
reviewed
Dec 1, 2023
luohaha
force-pushed
the
fix-bc-overflow
branch
2 times, most recently
from
December 1, 2023 22:24
9ead095
to
8758ff6
Compare
imay
reviewed
Dec 2, 2023
luohaha
force-pushed
the
fix-bc-overflow
branch
from
December 2, 2023 05:35
8758ff6
to
90a4fa5
Compare
Signed-off-by: luohaha <18810541851@163.com>
luohaha
force-pushed
the
fix-bc-overflow
branch
from
December 2, 2023 06:09
90a4fa5
to
1a0594d
Compare
[FE Incremental Coverage Report]✅ pass : 0 / 0 (0%) |
[BE Incremental Coverage Report]✅ pass : 8 / 8 (100.00%) file detail
|
imay
approved these changes
Dec 2, 2023
@Mergifyio backport branch-3.2 |
@Mergifyio backport branch-3.1 |
✅ Backports have been created
|
✅ Backports have been created
|
mergify bot
pushed a commit
that referenced
this pull request
Dec 2, 2023
…36281) Why I'm doing: In BinaryColumn, we use `vector<uint32_t> _offset` to store each rows offset in `vector<uint8_t> _bytes`. But if `_bytes` is large than 4GB, which means that offset will large than UINT32_MAX, offset overflow in `uint32`. To prevent this overflow, we add this check in pr #33521, and because overflow happens, check fail with BE crash. ``` template <typename T> void BinaryColumnBase<T>::_build_slices() const { if constexpr (std::is_same_v<T, uint32_t>) { CHECK_LT(_bytes.size(), (size_t)UINT32_MAX) << "BinaryColumn size overflow"; } ``` BE crash: ``` @ 0x5e50559 google::LogMessageFatal::~LogMessageFatal() @ 0x27ecfaf starrocks::BinaryColumnBase<>::_build_slices() @ 0x2757dd5 starrocks::BinaryColumnBase<>::raw_data() @ 0x480a0da starrocks::ScalarColumnWriter::append() @ 0x480a33c starrocks::StringColumnWriter::append() @ 0x43a2806 starrocks::SegmentWriter::append_chunk() @ 0x4a98da0 starrocks::VerticalRowsetWriter::add_columns() @ 0x4a73ac7 starrocks::VerticalCompactionTask::_compact_data() @ 0x4a74d0f starrocks::VerticalCompactionTask::_compact_column_group() @ 0x4a75632 starrocks::VerticalCompactionTask::_vertical_compaction_data() @ 0x4a76129 starrocks::VerticalCompactionTask::run_impl() @ 0x4a6b6fc starrocks::CompactionTask::run() @ 0x44d30d3 _ZNSt17_Function_handlerIFvvEZN9starrocks17CompactionManager9_scheduleEvEUlvE_E9_M_invokeERKSt9_Any_data @ 0x4cc33d2 starrocks::ThreadPool::dispatch_thread() @ 0x4cbde6a starrocks::Thread::supervise_thread() @ 0x7f4658c6644b start_thread @ 0x7f465803f40f __GI___clone @ 0x0 (unknown) ``` What I'm doing: Add byte size limit to dictionary speculate, and make sure dictionary speculate will not batch too large column and cause overflow. Signed-off-by: luohaha <18810541851@163.com> (cherry picked from commit f06e2c8)
mergify bot
pushed a commit
that referenced
this pull request
Dec 2, 2023
…36281) Why I'm doing: In BinaryColumn, we use `vector<uint32_t> _offset` to store each rows offset in `vector<uint8_t> _bytes`. But if `_bytes` is large than 4GB, which means that offset will large than UINT32_MAX, offset overflow in `uint32`. To prevent this overflow, we add this check in pr #33521, and because overflow happens, check fail with BE crash. ``` template <typename T> void BinaryColumnBase<T>::_build_slices() const { if constexpr (std::is_same_v<T, uint32_t>) { CHECK_LT(_bytes.size(), (size_t)UINT32_MAX) << "BinaryColumn size overflow"; } ``` BE crash: ``` @ 0x5e50559 google::LogMessageFatal::~LogMessageFatal() @ 0x27ecfaf starrocks::BinaryColumnBase<>::_build_slices() @ 0x2757dd5 starrocks::BinaryColumnBase<>::raw_data() @ 0x480a0da starrocks::ScalarColumnWriter::append() @ 0x480a33c starrocks::StringColumnWriter::append() @ 0x43a2806 starrocks::SegmentWriter::append_chunk() @ 0x4a98da0 starrocks::VerticalRowsetWriter::add_columns() @ 0x4a73ac7 starrocks::VerticalCompactionTask::_compact_data() @ 0x4a74d0f starrocks::VerticalCompactionTask::_compact_column_group() @ 0x4a75632 starrocks::VerticalCompactionTask::_vertical_compaction_data() @ 0x4a76129 starrocks::VerticalCompactionTask::run_impl() @ 0x4a6b6fc starrocks::CompactionTask::run() @ 0x44d30d3 _ZNSt17_Function_handlerIFvvEZN9starrocks17CompactionManager9_scheduleEvEUlvE_E9_M_invokeERKSt9_Any_data @ 0x4cc33d2 starrocks::ThreadPool::dispatch_thread() @ 0x4cbde6a starrocks::Thread::supervise_thread() @ 0x7f4658c6644b start_thread @ 0x7f465803f40f __GI___clone @ 0x0 (unknown) ``` What I'm doing: Add byte size limit to dictionary speculate, and make sure dictionary speculate will not batch too large column and cause overflow. Signed-off-by: luohaha <18810541851@163.com> (cherry picked from commit f06e2c8)
dingxin-tech
pushed a commit
to dingxin-tech/starrocks-odps
that referenced
this pull request
Dec 12, 2023
…tarRocks#36281) Why I'm doing: In BinaryColumn, we use `vector<uint32_t> _offset` to store each rows offset in `vector<uint8_t> _bytes`. But if `_bytes` is large than 4GB, which means that offset will large than UINT32_MAX, offset overflow in `uint32`. To prevent this overflow, we add this check in pr StarRocks#33521, and because overflow happens, check fail with BE crash. ``` template <typename T> void BinaryColumnBase<T>::_build_slices() const { if constexpr (std::is_same_v<T, uint32_t>) { CHECK_LT(_bytes.size(), (size_t)UINT32_MAX) << "BinaryColumn size overflow"; } ``` BE crash: ``` @ 0x5e50559 google::LogMessageFatal::~LogMessageFatal() @ 0x27ecfaf starrocks::BinaryColumnBase<>::_build_slices() @ 0x2757dd5 starrocks::BinaryColumnBase<>::raw_data() @ 0x480a0da starrocks::ScalarColumnWriter::append() @ 0x480a33c starrocks::StringColumnWriter::append() @ 0x43a2806 starrocks::SegmentWriter::append_chunk() @ 0x4a98da0 starrocks::VerticalRowsetWriter::add_columns() @ 0x4a73ac7 starrocks::VerticalCompactionTask::_compact_data() @ 0x4a74d0f starrocks::VerticalCompactionTask::_compact_column_group() @ 0x4a75632 starrocks::VerticalCompactionTask::_vertical_compaction_data() @ 0x4a76129 starrocks::VerticalCompactionTask::run_impl() @ 0x4a6b6fc starrocks::CompactionTask::run() @ 0x44d30d3 _ZNSt17_Function_handlerIFvvEZN9starrocks17CompactionManager9_scheduleEvEUlvE_E9_M_invokeERKSt9_Any_data @ 0x4cc33d2 starrocks::ThreadPool::dispatch_thread() @ 0x4cbde6a starrocks::Thread::supervise_thread() @ 0x7f4658c6644b start_thread @ 0x7f465803f40f __GI___clone @ 0x0 (unknown) ``` What I'm doing: Add byte size limit to dictionary speculate, and make sure dictionary speculate will not batch too large column and cause overflow. Signed-off-by: luohaha <18810541851@163.com> Signed-off-by: 鼎昕 <zhangdingxin.zdx@alibaba-inc.com>
https://github.com/Mergifyio backport branch-3.0 |
https://github.com/Mergifyio backport branch-2.5 |
✅ Backports have been created
|
✅ Backports have been created
|
mergify bot
pushed a commit
that referenced
this pull request
Dec 12, 2023
…36281) Why I'm doing: In BinaryColumn, we use `vector<uint32_t> _offset` to store each rows offset in `vector<uint8_t> _bytes`. But if `_bytes` is large than 4GB, which means that offset will large than UINT32_MAX, offset overflow in `uint32`. To prevent this overflow, we add this check in pr #33521, and because overflow happens, check fail with BE crash. ``` template <typename T> void BinaryColumnBase<T>::_build_slices() const { if constexpr (std::is_same_v<T, uint32_t>) { CHECK_LT(_bytes.size(), (size_t)UINT32_MAX) << "BinaryColumn size overflow"; } ``` BE crash: ``` @ 0x5e50559 google::LogMessageFatal::~LogMessageFatal() @ 0x27ecfaf starrocks::BinaryColumnBase<>::_build_slices() @ 0x2757dd5 starrocks::BinaryColumnBase<>::raw_data() @ 0x480a0da starrocks::ScalarColumnWriter::append() @ 0x480a33c starrocks::StringColumnWriter::append() @ 0x43a2806 starrocks::SegmentWriter::append_chunk() @ 0x4a98da0 starrocks::VerticalRowsetWriter::add_columns() @ 0x4a73ac7 starrocks::VerticalCompactionTask::_compact_data() @ 0x4a74d0f starrocks::VerticalCompactionTask::_compact_column_group() @ 0x4a75632 starrocks::VerticalCompactionTask::_vertical_compaction_data() @ 0x4a76129 starrocks::VerticalCompactionTask::run_impl() @ 0x4a6b6fc starrocks::CompactionTask::run() @ 0x44d30d3 _ZNSt17_Function_handlerIFvvEZN9starrocks17CompactionManager9_scheduleEvEUlvE_E9_M_invokeERKSt9_Any_data @ 0x4cc33d2 starrocks::ThreadPool::dispatch_thread() @ 0x4cbde6a starrocks::Thread::supervise_thread() @ 0x7f4658c6644b start_thread @ 0x7f465803f40f __GI___clone @ 0x0 (unknown) ``` What I'm doing: Add byte size limit to dictionary speculate, and make sure dictionary speculate will not batch too large column and cause overflow. Signed-off-by: luohaha <18810541851@163.com> (cherry picked from commit f06e2c8)
mergify bot
pushed a commit
that referenced
this pull request
Dec 12, 2023
…36281) Why I'm doing: In BinaryColumn, we use `vector<uint32_t> _offset` to store each rows offset in `vector<uint8_t> _bytes`. But if `_bytes` is large than 4GB, which means that offset will large than UINT32_MAX, offset overflow in `uint32`. To prevent this overflow, we add this check in pr #33521, and because overflow happens, check fail with BE crash. ``` template <typename T> void BinaryColumnBase<T>::_build_slices() const { if constexpr (std::is_same_v<T, uint32_t>) { CHECK_LT(_bytes.size(), (size_t)UINT32_MAX) << "BinaryColumn size overflow"; } ``` BE crash: ``` @ 0x5e50559 google::LogMessageFatal::~LogMessageFatal() @ 0x27ecfaf starrocks::BinaryColumnBase<>::_build_slices() @ 0x2757dd5 starrocks::BinaryColumnBase<>::raw_data() @ 0x480a0da starrocks::ScalarColumnWriter::append() @ 0x480a33c starrocks::StringColumnWriter::append() @ 0x43a2806 starrocks::SegmentWriter::append_chunk() @ 0x4a98da0 starrocks::VerticalRowsetWriter::add_columns() @ 0x4a73ac7 starrocks::VerticalCompactionTask::_compact_data() @ 0x4a74d0f starrocks::VerticalCompactionTask::_compact_column_group() @ 0x4a75632 starrocks::VerticalCompactionTask::_vertical_compaction_data() @ 0x4a76129 starrocks::VerticalCompactionTask::run_impl() @ 0x4a6b6fc starrocks::CompactionTask::run() @ 0x44d30d3 _ZNSt17_Function_handlerIFvvEZN9starrocks17CompactionManager9_scheduleEvEUlvE_E9_M_invokeERKSt9_Any_data @ 0x4cc33d2 starrocks::ThreadPool::dispatch_thread() @ 0x4cbde6a starrocks::Thread::supervise_thread() @ 0x7f4658c6644b start_thread @ 0x7f465803f40f __GI___clone @ 0x0 (unknown) ``` What I'm doing: Add byte size limit to dictionary speculate, and make sure dictionary speculate will not batch too large column and cause overflow. Signed-off-by: luohaha <18810541851@163.com> (cherry picked from commit f06e2c8)
11 tasks
22 tasks
trueeyu
pushed a commit
that referenced
this pull request
Mar 22, 2024
…36281) Why I'm doing: In BinaryColumn, we use `vector<uint32_t> _offset` to store each rows offset in `vector<uint8_t> _bytes`. But if `_bytes` is large than 4GB, which means that offset will large than UINT32_MAX, offset overflow in `uint32`. To prevent this overflow, we add this check in pr #33521, and because overflow happens, check fail with BE crash. ``` template <typename T> void BinaryColumnBase<T>::_build_slices() const { if constexpr (std::is_same_v<T, uint32_t>) { CHECK_LT(_bytes.size(), (size_t)UINT32_MAX) << "BinaryColumn size overflow"; } ``` BE crash: ``` @ 0x5e50559 google::LogMessageFatal::~LogMessageFatal() @ 0x27ecfaf starrocks::BinaryColumnBase<>::_build_slices() @ 0x2757dd5 starrocks::BinaryColumnBase<>::raw_data() @ 0x480a0da starrocks::ScalarColumnWriter::append() @ 0x480a33c starrocks::StringColumnWriter::append() @ 0x43a2806 starrocks::SegmentWriter::append_chunk() @ 0x4a98da0 starrocks::VerticalRowsetWriter::add_columns() @ 0x4a73ac7 starrocks::VerticalCompactionTask::_compact_data() @ 0x4a74d0f starrocks::VerticalCompactionTask::_compact_column_group() @ 0x4a75632 starrocks::VerticalCompactionTask::_vertical_compaction_data() @ 0x4a76129 starrocks::VerticalCompactionTask::run_impl() @ 0x4a6b6fc starrocks::CompactionTask::run() @ 0x44d30d3 _ZNSt17_Function_handlerIFvvEZN9starrocks17CompactionManager9_scheduleEvEUlvE_E9_M_invokeERKSt9_Any_data @ 0x4cc33d2 starrocks::ThreadPool::dispatch_thread() @ 0x4cbde6a starrocks::Thread::supervise_thread() @ 0x7f4658c6644b start_thread @ 0x7f465803f40f __GI___clone @ 0x0 (unknown) ``` What I'm doing: Add byte size limit to dictionary speculate, and make sure dictionary speculate will not batch too large column and cause overflow. Signed-off-by: luohaha <18810541851@163.com> (cherry picked from commit f06e2c8)
trueeyu
pushed a commit
to trueeyu/starrocks
that referenced
this pull request
Mar 26, 2024
…backport StarRocks#36281) (StarRocks#36902) Signed-off-by: Yixin Luo <18810541851@163.com> 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
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.
Why I'm doing:
In BinaryColumn, we use
vector<uint32_t> _offset
to store each rows offset invector<uint8_t> _bytes
. But if_bytes
is large than 4GB, which means that offset will large than UINT32_MAX, offset overflow inuint32
. To prevent this overflow, we add this check in pr #33521, and because overflow happens, check fail with BE crash.BE crash:
What I'm doing:
Add byte size limit to dictionary speculate, and make sure dictionary speculate will not batch too large column and cause overflow.
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check: