From 37fc47ee822cc0f37468c019fb9adc67096484bc Mon Sep 17 00:00:00 2001 From: Handora Date: Thu, 2 Mar 2023 15:33:37 +0000 Subject: [PATCH] [BUG] remove unexpected error msg --- .../ob_multi_version_garbage_collector.cpp | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/storage/concurrency_control/ob_multi_version_garbage_collector.cpp b/src/storage/concurrency_control/ob_multi_version_garbage_collector.cpp index df10f411cb..3844f43708 100644 --- a/src/storage/concurrency_control/ob_multi_version_garbage_collector.cpp +++ b/src/storage/concurrency_control/ob_multi_version_garbage_collector.cpp @@ -1180,16 +1180,11 @@ int ObMultiVersionGCSnapshotCalculator::operator()(const share::SCN snapshot_ver current_ts - create_time > 2 * ObMultiVersionGarbageCollector::GARBAGE_COLLECT_RECLAIM_DURATION && // for mock or test that change GARBAGE_COLLECT_EXEC_INTERVAL to a small value current_ts - create_time > 2 * 3 * 10_min) { - if (REACH_COUNT_INTERVAL(10L)) { - // we report error here for long time warning - MVCC_LOG(ERROR, "ignore too old version too long", K(snapshot_version), - K(snapshot_type), K(current_ts), K(create_time), K(addr)); - } else { - // we report WARN here because there may be servers offline and online - // suddenly and report a stale txn - MVCC_LOG(WARN, "ignore too old version", K(snapshot_version), - K(snapshot_type), K(current_ts), K(create_time), K(addr)); - } + // we report WARN here because there may be servers offline and online + // suddenly and report a stale txn or there may be tenant being dropped + // and alived server may fetch the tenant info + MVCC_LOG(WARN, "ignore too old version", K(snapshot_version), + K(snapshot_type), K(current_ts), K(create_time), K(addr)); } else { reserved_snapshot_version_ = snapshot_version; reserved_snapshot_type_ = snapshot_type; @@ -1342,7 +1337,17 @@ bool GetMinActiveSnapshotVersionFunctor::operator()(sql::ObSQLSessionMgr::Key ke } } - if (OB_SUCC(ret) && snapshot_version < min_active_snapshot_version_) { + if (OB_SUCC(ret) + && share::SCN::min_scn() != snapshot_version + && snapshot_version < min_active_snapshot_version_) { + const int64_t current_timestamp = ObClockGenerator::getRealClock(); + const int64_t snapshot_version_ts = snapshot_version.get_val_for_tx() / 1000; + if (snapshot_version_ts < current_timestamp + && current_timestamp - snapshot_version_ts > 100 * 1_min) { + MVCC_LOG(INFO, "GetMinActiveSnapshotVersionFunctor find a small snapshot txn", + K(MTL_ID()), KPC(sess_info), K(snapshot_version), + K(current_timestamp), K(min_active_snapshot_version_)); + } min_active_snapshot_version_ = snapshot_version; } }