Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
Yukang-Lian committed Nov 13, 2024
1 parent 7b2547c commit ab84952
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
12 changes: 12 additions & 0 deletions be/src/olap/compaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1127,6 +1127,18 @@ Status CloudCompactionMixin::execute_compact_impl(int64_t permits) {

RETURN_IF_ERROR(merge_input_rowsets());

DBUG_EXECUTE_IF("CloudFullCompaction::modify_rowsets.wrong_rowset_id", {
DCHECK(compaction_type() == ReaderType::READER_FULL_COMPACTION);
RowsetId id;
id.version = 2;
id.hi = _output_rowset->rowset_meta()->rowset_id().hi + ((int64_t)(1) << 56);
id.mi = _output_rowset->rowset_meta()->rowset_id().mi;
id.lo = _output_rowset->rowset_meta()->rowset_id().lo;
_output_rowset->rowset_meta()->set_rowset_id(id);
LOG(INFO) << "[Debug wrong rowset id]:"
<< _output_rowset->rowset_meta()->rowset_id().to_string();
})

RETURN_IF_ERROR(_engine.meta_mgr().commit_rowset(*_output_rowset->rowset_meta().get()));

// 4. modify rowsets in memory
Expand Down
3 changes: 3 additions & 0 deletions cloud/src/common/bvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,3 +193,6 @@ BvarStatusWithTag<long> g_bvar_checker_check_cost_s("checker", "check_cost_secon
BvarStatusWithTag<long> g_bvar_checker_enqueue_cost_s("checker", "enqueue_cost_seconds");
BvarStatusWithTag<long> g_bvar_checker_last_success_time_ms("checker", "last_success_time_ms");
BvarStatusWithTag<long> g_bvar_checker_instance_volume("checker", "instance_volume");
BvarStatusWithTag<long> g_bvar_inverted_checker_num_scanned("checker", "num_inverted_scanned");
BvarStatusWithTag<long> g_bvar_inverted_checker_num_check_failed("checker",
"num_inverted_check_failed");
2 changes: 2 additions & 0 deletions cloud/src/common/bvars.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,5 @@ extern BvarStatusWithTag<long> g_bvar_checker_check_cost_s;
extern BvarStatusWithTag<long> g_bvar_checker_enqueue_cost_s;
extern BvarStatusWithTag<long> g_bvar_checker_last_success_time_ms;
extern BvarStatusWithTag<long> g_bvar_checker_instance_volume;
extern BvarStatusWithTag<long> g_bvar_inverted_checker_num_scanned;
extern BvarStatusWithTag<long> g_bvar_inverted_checker_num_check_failed;
14 changes: 9 additions & 5 deletions cloud/src/recycler/checker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,17 @@ int Checker::start() {
auto ctime_ms =
duration_cast<milliseconds>(system_clock::now().time_since_epoch()).count();
g_bvar_checker_enqueue_cost_s.put(instance_id, ctime_ms / 1000 - enqueue_time_s);
ret = checker->do_check();
int ret1 = checker->do_check();
if (ret1 == -1) return;
int ret2;
if (config::enable_inverted_check) {
if (checker->do_inverted_check() != 0) ret = -1;
ret2 = checker->do_inverted_check();
if (ret2 == -1) return;
}
if (ret == -1) return;
// If instance checker has been aborted, don't finish this job
if (!checker->stopped()) {
finish_instance_recycle_job(txn_kv_.get(), check_job_key, instance.instance_id(),
ip_port_, ret == 0, ctime_ms);
ip_port_, ret1 == 0 && ret2 == 0, ctime_ms);
}
{
std::lock_guard lock(mtx_);
Expand Down Expand Up @@ -606,6 +608,8 @@ int InstanceChecker::do_inverted_check() {
using namespace std::chrono;
auto start_time = steady_clock::now();
std::unique_ptr<int, std::function<void(int*)>> defer_log_statistics((int*)0x01, [&](int*) {
g_bvar_inverted_checker_num_scanned.put(instance_id_, num_scanned);
g_bvar_inverted_checker_num_check_failed.put(instance_id_, num_check_failed);
auto cost = duration<float>(steady_clock::now() - start_time).count();
LOG(INFO) << "inverted check instance objects finished, cost=" << cost
<< "s. instance_id=" << instance_id_ << " num_scanned=" << num_scanned
Expand Down Expand Up @@ -719,7 +723,7 @@ int InstanceChecker::do_inverted_check() {
return -1;
}
}
return num_check_failed == 0 ? 0 : -1;
return num_check_failed == 0 ? 0 : -2;
}

} // namespace doris::cloud

0 comments on commit ab84952

Please sign in to comment.