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

[enhancement](log) print detail error for segment compaction failure #30503

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 8 additions & 3 deletions be/src/olap/rowset/beta_rowset_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ Status BetaRowsetWriter::_segcompaction_if_necessary() {
}
if (_segcompaction_status.load() != OK) {
status = Status::Error<SEGCOMPACTION_FAILED>(
"BetaRowsetWriter::_segcompaction_if_necessary meet invalid state");
"BetaRowsetWriter::_segcompaction_if_necessary meet invalid state, error code: {}",
_segcompaction_status);
} else if ((_num_segment - _segcompacted_point) >= config::segcompaction_batch_size) {
SegCompactionCandidatesSharedPtr segments;
status = _find_longest_consecutive_small_segment(segments);
Expand Down Expand Up @@ -425,7 +426,9 @@ Status BetaRowsetWriter::_segcompaction_rename_last_segments() {
}
if (_segcompaction_status.load() != OK) {
return Status::Error<SEGCOMPACTION_FAILED>(
"BetaRowsetWriter::_segcompaction_rename_last_segments meet invalid state");
"BetaRowsetWriter::_segcompaction_rename_last_segments meet invalid state, error "
"code: {}",
_segcompaction_status.load());
}
if (!_is_segcompacted() || _segcompacted_point == _num_segment) {
// no need if never segcompact before or all segcompacted
Expand Down Expand Up @@ -501,7 +504,9 @@ Status BetaRowsetWriter::_wait_flying_segcompaction() {
LOG(INFO) << "wait flying segcompaction finish time:" << elapsed << "us";
}
if (_segcompaction_status.load() != OK) {
return Status::Error<SEGCOMPACTION_FAILED>("BetaRowsetWriter meet invalid state.");
return Status::Error<SEGCOMPACTION_FAILED>(
"BetaRowsetWriter meet invalid state, error code: {}",
_segcompaction_status.load());
}
return Status::OK();
}
Expand Down
3 changes: 2 additions & 1 deletion be/src/olap/rowset/segcompaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ Status SegcompactionWorker::_do_compact_segments(SegCompactionCandidatesSharedPt
auto s = _get_segcompaction_reader(segments, tablet, schema, &reader_stats, row_sources_buf,
is_key, column_ids, &reader);
if (UNLIKELY(reader == nullptr || !s.ok())) {
return Status::Error<SEGCOMPACTION_INIT_READER>("failed to get segcompaction reader.");
return Status::Error<SEGCOMPACTION_INIT_READER>(
"failed to get segcompaction reader. err: {}", s.to_string());
}

Merger::Statistics merger_stats;
Expand Down
Loading