diff --git a/src/storage/ls/ob_ls.h b/src/storage/ls/ob_ls.h index e527dd1a2..6b5d40595 100755 --- a/src/storage/ls/ob_ls.h +++ b/src/storage/ls/ob_ls.h @@ -765,6 +765,7 @@ public: DELEGATE_WITH_RET(ls_tx_svr_, get_tx_ctx_count, int); DELEGATE_WITH_RET(ls_tx_svr_, get_active_tx_count, int); + DELEGATE_WITH_RET(ls_tx_svr_, print_all_tx_ctx, int); //dup table ls meta interface CONST_DELEGATE_WITH_RET(dup_table_ls_handler_, get_dup_table_ls_meta, int); DELEGATE_WITH_RET(dup_table_ls_handler_, set_dup_table_ls_meta, int); diff --git a/src/storage/ls/ob_ls_tx_service.cpp b/src/storage/ls/ob_ls_tx_service.cpp index 9860293c1..757ab1d86 100644 --- a/src/storage/ls/ob_ls_tx_service.cpp +++ b/src/storage/ls/ob_ls_tx_service.cpp @@ -775,6 +775,19 @@ int ObLSTxService::get_active_tx_count(int64_t &active_tx_count) return ret; } +int ObLSTxService::print_all_tx_ctx(const int64_t print_num) +{ + int ret = OB_SUCCESS; + if (OB_ISNULL(mgr_)) { + ret = OB_NOT_INIT; + TRANS_LOG(WARN, "not init", KR(ret), K_(ls_id)); + } else { + const bool verbose = true; + mgr_->print_all_tx_ctx(print_num, verbose); + } + return ret; +} + int ObLSTxService::set_max_replay_commit_version(share::SCN commit_version) { int ret = OB_SUCCESS; diff --git a/src/storage/ls/ob_ls_tx_service.h b/src/storage/ls/ob_ls_tx_service.h index 63e713505..4a609bc28 100644 --- a/src/storage/ls/ob_ls_tx_service.h +++ b/src/storage/ls/ob_ls_tx_service.h @@ -147,6 +147,8 @@ public: int iterate_tx_obj_lock_op(transaction::tablelock::ObLockOpIterator &iter) const; int get_tx_ctx_count(int64_t &tx_ctx_count); int get_active_tx_count(int64_t &active_tx_count); + int print_all_tx_ctx(const int64_t print_num); + public: int replay(const void *buffer, const int64_t nbytes, const palf::LSN &lsn, const share::SCN &scn); diff --git a/src/storage/ob_storage_rpc.cpp b/src/storage/ob_storage_rpc.cpp index a7cb3b6db..826989997 100644 --- a/src/storage/ob_storage_rpc.cpp +++ b/src/storage/ob_storage_rpc.cpp @@ -2537,6 +2537,10 @@ int ObGetLSActiveTransCountP::process() LOG_WARN("src ls migration status is not none", K(ret), K(migration_status), KPC(ls), K(arg_)); } else if (OB_FAIL(ls->get_active_tx_count(result_.active_trans_count_))) { LOG_WARN("failed to get active trans count", K(ret), KPC(ls), K(arg_)); + } else if (0 == result_.active_trans_count_) { + // do nothing + } else if (OB_FAIL(ls->print_all_tx_ctx(1/*print_num*/))) { + LOG_WARN("failed to print all tx ctx", K(ret), KPC(ls)); } } return ret;