Add some logs for compaction process (#1163)
This commit is contained in:
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
@ -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;
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user