Skip to content

Commit

Permalink
Revert "[Enhancement](compaction) Do not set failure time when cumula…
Browse files Browse the repository at this point in the history
…tive compaction dealing with delete rowset (apache#43466)"

This reverts commit 55f450c.
  • Loading branch information
mymeiyi committed Dec 16, 2024
1 parent 0f01a25 commit 7547650
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 148 deletions.
4 changes: 0 additions & 4 deletions be/src/cloud/cloud_cumulative_compaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ Status CloudCumulativeCompaction::prepare_compact() {
// plus 1 to skip the delete version.
// NOTICE: after that, the cumulative point may be larger than max version of this tablet, but it doesn't matter.
update_cumulative_point();
if (!config::enable_sleep_between_delete_cumu_compaction) {
st = Status::Error<CUMULATIVE_NO_SUITABLE_VERSION>(
"_last_delete_version.first not equal to -1");
}
}
return st;
}
Expand Down
3 changes: 1 addition & 2 deletions be/src/cloud/cloud_storage_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,7 @@ Status CloudStorageEngine::_submit_cumulative_compaction_task(const CloudTabletS
auto st = compaction->prepare_compact();
if (!st.ok()) {
long now = duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
if (st.is<ErrorCode::CUMULATIVE_NO_SUITABLE_VERSION>() &&
st.msg() != "_last_delete_version.first not equal to -1") {
if (st.is<ErrorCode::CUMULATIVE_NO_SUITABLE_VERSION>()) {
// Backoff strategy if no suitable version
tablet->last_cumu_no_suitable_version_ms = now;
}
Expand Down
1 change: 0 additions & 1 deletion be/src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,6 @@ DEFINE_mBool(enable_delete_bitmap_merge_on_compaction, "false");
// Enable validation to check the correctness of table size.
DEFINE_Bool(enable_table_size_correctness_check, "false");
DEFINE_Bool(force_regenerate_rowsetid_on_start_error, "false");
DEFINE_mBool(enable_sleep_between_delete_cumu_compaction, "false");

// clang-format off
#ifdef BE_TEST
Expand Down
2 changes: 0 additions & 2 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1487,8 +1487,6 @@ DECLARE_Bool(force_regenerate_rowsetid_on_start_error);
DECLARE_mBool(enable_delete_bitmap_merge_on_compaction);
// Enable validation to check the correctness of table size.
DECLARE_Bool(enable_table_size_correctness_check);
// Enable sleep 5s between delete cumulative compaction.
DECLARE_mBool(enable_sleep_between_delete_cumu_compaction);

#ifdef BE_TEST
// test s3
Expand Down
13 changes: 1 addition & 12 deletions be/src/olap/tablet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1740,26 +1740,15 @@ Status Tablet::prepare_compaction_and_calculate_permits(
}

if (!res.ok()) {
tablet->set_last_cumu_compaction_failure_time(UnixMillis());
permits = 0;
// if we meet a delete version, should increase the cumulative point to let base compaction handle the delete version.
// no need to wait 5s.
if (!(res.msg() == "_last_delete_version.first not equal to -1") ||
config::enable_sleep_between_delete_cumu_compaction) {
tablet->set_last_cumu_compaction_failure_time(UnixMillis());
}
if (!res.is<CUMULATIVE_NO_SUITABLE_VERSION>()) {
DorisMetrics::instance()->cumulative_compaction_request_failed->increment(1);
return Status::InternalError("prepare cumulative compaction with err: {}", res);
}
// return OK if OLAP_ERR_CUMULATIVE_NO_SUITABLE_VERSION, so that we don't need to
// print too much useless logs.
// And because we set permits to 0, so even if we return OK here, nothing will be done.
LOG_INFO(
"cumulative compaction meet delete rowset, increase cumu point without other "
"operation.")
.tag("tablet id:", tablet->tablet_id())
.tag("after cumulative compaction, cumu point:",
tablet->cumulative_layer_point());
return Status::OK();
}
} else if (compaction_type == CompactionType::BASE_COMPACTION) {
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 7547650

Please sign in to comment.