Skip to content

Commit

Permalink
cleanup _is_doing_segcompaction
Browse files Browse the repository at this point in the history
  • Loading branch information
kaijchen committed Aug 26, 2024
1 parent 66ccb70 commit 2b78a3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
9 changes: 2 additions & 7 deletions be/src/olap/rowset/beta_rowset_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,11 +514,6 @@ Status BetaRowsetWriter::_rename_compacted_indices(int64_t begin, int64_t end, u
return Status::OK();
}

// return true if there is any flying segcompaction, otherwise return false
bool BetaRowsetWriter::_check_and_set_is_doing_segcompaction() {
return _is_doing_segcompaction.exchange(true);
}

Status BetaRowsetWriter::_segcompaction_if_necessary() {
Status status = Status::OK();
// if not doing segcompaction, just check segment number
Expand All @@ -527,9 +522,9 @@ Status BetaRowsetWriter::_segcompaction_if_necessary() {
_context.tablet_schema->num_variant_columns() > 0) {
return _check_segment_number_limit(_num_segment);
}
// leave _check_and_set_is_doing_segcompaction as the last condition
// leave _is_doing_segcompaction as the last condition
// otherwise _segcompacting_cond will never get notified
if (_check_and_set_is_doing_segcompaction()) {
if (_is_doing_segcompaction.exchange(true)) {
return status;
}
if (_segcompaction_status.load() != OK) {
Expand Down
1 change: 0 additions & 1 deletion be/src/olap/rowset/beta_rowset_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ class BetaRowsetWriter : public BaseBetaRowsetWriter {
Status _segcompaction_rename_last_segments();
Status _load_noncompacted_segment(segment_v2::SegmentSharedPtr& segment, int32_t segment_id);
Status _find_longest_consecutive_small_segment(SegCompactionCandidatesSharedPtr& segments);
bool _check_and_set_is_doing_segcompaction();
Status _rename_compacted_segments(int64_t begin, int64_t end);
Status _rename_compacted_segment_plain(uint64_t seg_id);
Status _rename_compacted_indices(int64_t begin, int64_t end, uint64_t seg_id);
Expand Down

0 comments on commit 2b78a3a

Please sign in to comment.