From 9a236eda0f31f0eb78f64ff61031d461367c3450 Mon Sep 17 00:00:00 2001 From: obdev Date: Wed, 26 Oct 2022 11:58:44 +0000 Subject: [PATCH] fix cb may not be set --- src/storage/tx/ob_id_service.cpp | 7 +++++++ src/storage/tx/ob_id_service.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/storage/tx/ob_id_service.cpp b/src/storage/tx/ob_id_service.cpp index c3fac3735..6b5333a31 100644 --- a/src/storage/tx/ob_id_service.cpp +++ b/src/storage/tx/ob_id_service.cpp @@ -117,6 +117,10 @@ int ObIDService::submit_log_(const int64_t last_id, const int64_t limited_id) } else if (last_id < 0 || limited_id < 0) { ret = OB_INVALID_ARGUMENT; TRANS_LOG(WARN, "invalid argument", K(ret), K(last_id), K(limited_id)); + } else if (limited_id <= ATOMIC_LOAD(&limited_id_)) { + if (EXECUTE_COUNT_PER_SEC(10)) { + TRANS_LOG(INFO, "no log required", K(limited_id), K(ATOMIC_LOAD(&limited_id_))); + } } else if (OB_FAIL(check_and_fill_ls())) { TRANS_LOG(WARN, "ls set fail", K(ret)); } else { @@ -500,6 +504,7 @@ int ObPresistIDLogCb::on_success() ret = OB_ERR_UNEXPECTED; TRANS_LOG(WARN, "timestamp service is null", K(ret)); } else { + timestamp_service->test_lock(); if (OB_FAIL(timestamp_service->handle_submit_callback(true, limited_id_, log_ts_))) { TRANS_LOG(WARN, "timestamp service handle log callback fail", K(ret), K_(limited_id), K_(log_ts)); } @@ -513,6 +518,7 @@ int ObPresistIDLogCb::on_success() ret = OB_ERR_UNEXPECTED; TRANS_LOG(WARN, "trans id service is null", K(ret)); } else { + trans_id_service->test_lock(); if (OB_FAIL(trans_id_service->handle_submit_callback(true, limited_id_, log_ts_))) { TRANS_LOG(WARN, "trans id service handle log callback fail", K(ret), K_(limited_id), K_(log_ts)); } @@ -526,6 +532,7 @@ int ObPresistIDLogCb::on_success() ret = OB_ERR_UNEXPECTED; TRANS_LOG(WARN, "das id service is null", K(ret)); } else { + das_id_service->test_lock(); if (OB_FAIL(das_id_service->handle_submit_callback(true, limited_id_, log_ts_))) { TRANS_LOG(WARN, "das id service handle log callback fail", K(ret), K_(limited_id), K_(log_ts)); } diff --git a/src/storage/tx/ob_id_service.h b/src/storage/tx/ob_id_service.h index bef4f4829..0bb5a0a58 100644 --- a/src/storage/tx/ob_id_service.h +++ b/src/storage/tx/ob_id_service.h @@ -103,6 +103,7 @@ public: //日志处理 int handle_submit_callback(const bool success, const int64_t limited_id, const int64_t log_ts); + void test_lock() { WLockGuard guard(rwlock_); } //获取回放数据 int handle_replay_result(const int64_t last_id, const int64_t limited_id, const int64_t log_ts);