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

[chore](rowset writer) print rowset rows number when meet too many segments #39091

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions be/src/olap/rowset/beta_rowset_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -913,9 +913,9 @@ Status BaseBetaRowsetWriter::_check_segment_number_limit() {
if (UNLIKELY(total_segment_num > config::max_segment_num_per_rowset)) {
return Status::Error<TOO_MANY_SEGMENTS>(
"too many segments in rowset. tablet_id:{}, rowset_id:{}, max:{}, "
"_num_segment:{}, ",
"_num_segment:{}, rowset_num_rows:{}",
_context.tablet_id, _context.rowset_id.to_string(),
config::max_segment_num_per_rowset, _num_segment);
config::max_segment_num_per_rowset, _num_segment, get_rowset_num_rows());
}
return Status::OK();
}
Expand All @@ -927,10 +927,10 @@ Status BetaRowsetWriter::_check_segment_number_limit() {
if (UNLIKELY(total_segment_num > config::max_segment_num_per_rowset)) {
return Status::Error<TOO_MANY_SEGMENTS>(
"too many segments in rowset. tablet_id:{}, rowset_id:{}, max:{}, _num_segment:{}, "
"_segcompacted_point:{}, _num_segcompacted:{}",
"_segcompacted_point:{}, _num_segcompacted:{}, rowset_num_rows:{}",
_context.tablet_id, _context.rowset_id.to_string(),
config::max_segment_num_per_rowset, _num_segment, _segcompacted_point,
_num_segcompacted);
_num_segcompacted, get_rowset_num_rows());
}
return Status::OK();
}
Expand Down
5 changes: 5 additions & 0 deletions be/src/olap/rowset/beta_rowset_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ class BaseBetaRowsetWriter : public RowsetWriter {
// build a tmp rowset for load segment to calc delete_bitmap for this segment
Status _build_tmp(RowsetSharedPtr& rowset_ptr);

uint64_t get_rowset_num_rows() {
std::lock_guard l(_segid_statistics_map_mutex);
return std::accumulate(_segment_num_rows.begin(), _segment_num_rows.end(), uint64_t(0));
}

std::atomic<int32_t> _num_segment; // number of consecutive flushed segments
roaring::Roaring _segment_set; // bitmap set to record flushed segment id
std::mutex _segment_set_mutex; // mutex for _segment_set
Expand Down
Loading