diff --git a/src/rootserver/freeze/ob_checksum_validator.cpp b/src/rootserver/freeze/ob_checksum_validator.cpp index 40c82e824c..8ffe51945d 100755 --- a/src/rootserver/freeze/ob_checksum_validator.cpp +++ b/src/rootserver/freeze/ob_checksum_validator.cpp @@ -69,11 +69,11 @@ int ObChecksumValidator::set_basic_info( ret = OB_INVALID_ARGUMENT; LOG_WARN("invalid argument", KR(ret), K(frozen_scn), K(expected_epoch)); } else if (FALSE_IT(compaction_scn_ = frozen_scn)) { + } else if (FALSE_IT(major_merge_start_us_ = ObTimeUtility::fast_current_time())) { } else if (OB_FAIL(set_need_validate())) { // init compaction_scn_ before call this func LOG_WARN("failed to set need_validate", K(ret), K_(tenant_id), K_(is_primary_service)); } else { expected_epoch_ = expected_epoch; - major_merge_start_us_ = ObTimeUtility::fast_current_time(); statistics_.reset(); } return ret; @@ -542,9 +542,11 @@ int ObChecksumValidator::check_tablet_checksum_sync_finish(const bool force_chec LOG_WARN("fail to check is first tablet in first ls exist", KR(ret), K_(tenant_id), K_(compaction_scn)); } else if (is_exist) { cross_cluster_ckm_sync_finish_ = true; + } else if (is_primary_service_) { + cross_cluster_ckm_sync_finish_ = false; } else { cross_cluster_ckm_sync_finish_ = check_waiting_tablet_checksum_timeout(); - if (!is_primary_service_ && TC_REACH_TIME_INTERVAL(PRINT_CROSS_CLUSTER_LOG_INVERVAL)) { + if (TC_REACH_TIME_INTERVAL(PRINT_CROSS_CLUSTER_LOG_INVERVAL)) { LOG_WARN("can not check cross-cluster checksum now, please wait until first tablet" "in sys ls exists", K_(tenant_id), K_(compaction_scn), K_(major_merge_start_us), "fast_current_time_us", ObTimeUtil::fast_current_time(), K(is_exist), K_(is_primary_service)); @@ -625,7 +627,11 @@ bool ObChecksumValidator::check_waiting_tablet_checksum_timeout() const { const int64_t total_wait_time_us = (ObTimeUtil::fast_current_time() - major_merge_start_us_); - return (total_wait_time_us > MAX_TABLET_CHECKSUM_WAIT_TIME_US); + const bool is_timeout = (total_wait_time_us > MAX_TABLET_CHECKSUM_WAIT_TIME_US); + if (is_timeout) { + LOG_WARN_RET(OB_TIMEOUT, "check waiting tablet checksum timeout", K_(major_merge_start_us), K(total_wait_time_us)); + } + return is_timeout; } int ObChecksumValidator::try_update_tablet_checksum_items()