Skip to content

Commit

Permalink
fix http triggerd compaction
Browse files Browse the repository at this point in the history
  • Loading branch information
gitccl committed Apr 26, 2023
1 parent 48cb68b commit 0daa7f8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions be/src/http/action/compaction_action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ Status CompactionAction::_execute_compaction_callback(TabletSharedPtr tablet,
res = Status::Error<TRY_LOCK_FAILED>();
} else {
StorageEngine::instance()->create_base_compaction(tablet, base_compaction);
Status res = base_compaction->prepare_compact();
res = base_compaction->prepare_compact();
if (res.ok()) {
tablet->set_base_compaction(base_compaction);
need_reset = true;
Expand Down Expand Up @@ -240,7 +240,7 @@ Status CompactionAction::_execute_compaction_callback(TabletSharedPtr tablet,
bool need_reset = false;
{
std::unique_lock compaction_meta_lock(tablet->get_compaction_meta_lock());
Status res = cumu_compaction->prepare_compact();
res = cumu_compaction->prepare_compact();
if (res.ok()) {
tablet->add_cumulative_compaction_unlocked(cumu_compaction);
need_reset = true;
Expand All @@ -255,7 +255,7 @@ Status CompactionAction::_execute_compaction_callback(TabletSharedPtr tablet,
}

if (!res) {
if (res.is<BE_NO_SUITABLE_VERSION>()) {
if (res.is<CUMULATIVE_NO_SUITABLE_VERSION>()) {
// Ignore this error code.
VLOG_NOTICE << "failed to init cumulative compaction due to no suitable version,"
<< "tablet=" << tablet->full_name();
Expand Down
2 changes: 0 additions & 2 deletions be/src/olap/base_compaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ class BaseCompaction : public Compaction {
Status prepare_compact() override;
Status execute_compact_impl() override;

std::vector<RowsetSharedPtr> get_input_rowsets() { return _input_rowsets; }

protected:
Status pick_rowsets_to_compact() override;
std::string compaction_name() const override { return "base compaction"; }
Expand Down
1 change: 1 addition & 0 deletions be/src/olap/compaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ bool Compaction::handle_ordered_data_compaction() {
if (i <= input_size / 2) {
return false;
} else {
// TODO(ccl): other thread will read _input_rowsets, maybe add a lock
_input_rowsets.resize(i);
break;
}
Expand Down
2 changes: 0 additions & 2 deletions be/src/olap/cumulative_compaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ class CumulativeCompaction : public Compaction {
Status prepare_compact() override;
Status execute_compact_impl() override;

const std::vector<RowsetSharedPtr>& get_input_rowsets() { return _input_rowsets; }

protected:
Status pick_rowsets_to_compact() override;

Expand Down

0 comments on commit 0daa7f8

Please sign in to comment.