Skip to content

Commit

Permalink
print rowset rows number when meet too many segments
Browse files Browse the repository at this point in the history
  • Loading branch information
sollhui committed Aug 8, 2024
1 parent 55d63a8 commit 559cbef
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions be/src/olap/rowset/beta_rowset_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -910,12 +910,16 @@ Status BaseBetaRowsetWriter::_check_segment_number_limit() {
size_t total_segment_num = _num_segment + 1;
DBUG_EXECUTE_IF("BetaRowsetWriter._check_segment_number_limit_too_many_segments",
{ total_segment_num = dp->param("segnum", 1024); });
uint32_t rowset_num_rows = 0;
for (uint32_t num : _segment_num_rows) {
rowset_num_rows += num;
}
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, rowset_num_rows);
}
return Status::OK();
}
Expand All @@ -924,13 +928,17 @@ Status BetaRowsetWriter::_check_segment_number_limit() {
size_t total_segment_num = _num_segment - _segcompacted_point + 1 + _num_segcompacted;
DBUG_EXECUTE_IF("BetaRowsetWriter._check_segment_number_limit_too_many_segments",
{ total_segment_num = dp->param("segnum", 1024); });
uint32_t rowset_num_rows = 0;
for (uint32_t num : _segment_num_rows) {
rowset_num_rows += num;
}
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, rowset_num_rows);
}
return Status::OK();
}
Expand Down

0 comments on commit 559cbef

Please sign in to comment.