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

Add some logs for compaction process #1163

Merged
merged 1 commit into from
May 15, 2019
Merged
Changes from all commits
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
22 changes: 15 additions & 7 deletions be/src/olap/olap_engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1842,11 +1842,14 @@ void OLAPEngine::perform_cumulative_compaction(OlapStore* store) {
OLAPStatus res = cumulative_compaction.init(best_table);
if (res != OLAP_SUCCESS) {
if (res != OLAP_ERR_CUMULATIVE_REPEAT_INIT && res != OLAP_ERR_CE_TRY_CE_LOCK_ERROR) {
DorisMetrics::cumulative_compaction_request_failed.increment(1);
best_table->set_last_compaction_failure_time(UnixMillis());
LOG(WARNING) << "failed to init cumulative compaction"
<< ", table=" << best_table->full_name()
<< ", res=" << res;

if (res != OLAP_ERR_CUMULATIVE_NO_SUITABLE_VERSIONS) {
DorisMetrics::cumulative_compaction_request_failed.increment(1);
}
}
return;
}
Expand Down Expand Up @@ -1905,6 +1908,12 @@ OLAPTablePtr OLAPEngine::_find_best_tablet_to_compaction(CompactionType compacti
continue;
}

if (now - table_ptr->last_compaction_failure_time() <= config::min_compaction_failure_interval_sec * 1000) {
LOG(INFO) << "tablet last compaction failure time is: " << table_ptr->last_compaction_failure_time()
<< ", tablet: " << table_ptr->tablet_id() << ", skip it.";
continue;
}

if (compaction_type == CompactionType::CUMULATIVE_COMPACTION) {
if (!table_ptr->try_cumulative_lock()) {
continue;
Expand All @@ -1920,12 +1929,6 @@ OLAPTablePtr OLAPEngine::_find_best_tablet_to_compaction(CompactionType compacti
table_ptr->release_base_compaction_lock();
}
}

if (now - table_ptr->last_compaction_failure_time() <= config::min_compaction_failure_interval_sec * 1000) {
LOG(INFO) << "tablet last compaction failure time is: " << table_ptr->last_compaction_failure_time()
<< ", skip it";
continue;
}

ReadLock rdlock(table_ptr->get_header_lock_ptr());
uint32_t table_score = 0;
Expand All @@ -1940,6 +1943,11 @@ OLAPTablePtr OLAPEngine::_find_best_tablet_to_compaction(CompactionType compacti
}
}
}

if (best_table != nullptr) {
LOG(INFO) << "find best tablet to do compaction. type: " << (compaction_type == CompactionType::CUMULATIVE_COMPACTION ? "cumulative" : "base")
<< ", tablet id: " << best_table->tablet_id() << ", score: " << highest_score;
}
return best_table;
}

Expand Down