diff --git a/src/storage/ls/ob_ls.cpp b/src/storage/ls/ob_ls.cpp index 27b73a2b0..1fd2f0569 100755 --- a/src/storage/ls/ob_ls.cpp +++ b/src/storage/ls/ob_ls.cpp @@ -1250,6 +1250,9 @@ int ObLS::get_ls_info(ObLSVTInfo &ls_info) ls_info.tablet_change_checkpoint_scn_ = ls_meta_.get_tablet_change_checkpoint_scn(); ls_info.transfer_scn_ = ls_meta_.get_transfer_scn(); ls_info.tx_blocked_ = tx_blocked; + if (tx_blocked) { + TRANS_LOG(INFO, "current ls is blocked", K(ls_info)); + } } return ret; } diff --git a/src/storage/ls/ob_ls.h b/src/storage/ls/ob_ls.h index 08024ea65..d6b451433 100755 --- a/src/storage/ls/ob_ls.h +++ b/src/storage/ls/ob_ls.h @@ -94,6 +94,18 @@ struct ObLSVTInfo share::SCN tablet_change_checkpoint_scn_; share::SCN transfer_scn_; bool tx_blocked_; + TO_STRING_KV(K_(ls_id), + K_(replica_type), + K_(ls_state), + K_(migrate_status), + K_(tablet_count), + K_(weak_read_scn), + K_(checkpoint_scn), + K_(checkpoint_lsn), + K_(rebuild_seq), + K_(tablet_change_checkpoint_scn), + K_(transfer_scn), + K_(tx_blocked)); }; // 诊断虚表统计信息 diff --git a/src/storage/tx/wrs/ob_black_list.cpp b/src/storage/tx/wrs/ob_black_list.cpp index 51f1da9c6..d0c899f9b 100644 --- a/src/storage/tx/wrs/ob_black_list.cpp +++ b/src/storage/tx/wrs/ob_black_list.cpp @@ -245,7 +245,7 @@ int ObBLService::do_black_list_check_(sqlclient::ObMySQLResult *result) TRANS_LOG(WARN, "get_info_from_result_ fail ", KR(ret), K(result)); } else if (ls_info.is_leader()) { // cannot add leader into blacklist - } else if (ls_info.weak_read_scn_ == 0 && ls_info.migrate_status_ == OB_MIGRATE_STATUS_NONE) { + } else if (ls_info.weak_read_scn_ == 0) { // log stream is initializing, should't be put into blacklist } else if (OB_FAIL(OB_TS_MGR.get_gts(bl_key.get_tenant_id(), NULL, gts_scn))) { TRANS_LOG(WARN, "get gts scn error", K(ret), K(bl_key)); @@ -324,6 +324,9 @@ int ObBLService::get_info_from_result_(sqlclient::ObMySQLResult &result, ObBLKey } else if (OB_FAIL(ls_info.init(ls_role, weak_read_scn, migrate_status, tx_blocked))) { TRANS_LOG(WARN, "ls_info init fail", K(ls_role), K(weak_read_scn), K(migrate_status), K(tx_blocked)); } + if (tx_blocked) { + TRANS_LOG(INFO, "current ls is blocked, need to put blacklist", K(bl_key), K(ls_info)); + } return ret; } diff --git a/src/storage/tx/wrs/ob_black_list.h b/src/storage/tx/wrs/ob_black_list.h index d8dde16e3..d99a8a9a4 100644 --- a/src/storage/tx/wrs/ob_black_list.h +++ b/src/storage/tx/wrs/ob_black_list.h @@ -23,7 +23,7 @@ // 判断时间戳是否赶上/落后的缓冲时间(ns),避免阈值附近的日志流反复加入/移出黑名单 #define BLACK_LIST_WHITEWASH_INTERVAL_NS 1000000000 // 1s // 黑名单信息打印时间间隔(us) -#define BLACK_LIST_PRINT_INTERVAL 10000000 // 10s +#define BLACK_LIST_PRINT_INTERVAL 5000000 // 5s // 清理超时对象的时间间隔(us),这些对象不会出现在 SQLResult 中,比如切换server之后旧server上的日志流 #define BLACK_LIST_CLEAN_UP_INTERVAL 5000000 // 5s // 最大连续失败次数,连续刷新黑名单失败 达到 该次数则清空黑名单 diff --git a/src/storage/tx/wrs/ob_ls_wrs_handler.cpp b/src/storage/tx/wrs/ob_ls_wrs_handler.cpp index c2684658f..f8494f3d4 100644 --- a/src/storage/tx/wrs/ob_ls_wrs_handler.cpp +++ b/src/storage/tx/wrs/ob_ls_wrs_handler.cpp @@ -45,6 +45,7 @@ int ObLSWRSHandler::init(const share::ObLSID &ls_id) void ObLSWRSHandler::reset() { is_inited_ = false; + // set weak read ts to 0 ls_weak_read_ts_.set_min(); is_enabled_ = false; ls_id_.reset(); @@ -55,7 +56,8 @@ int ObLSWRSHandler::offline() int ret = OB_SUCCESS; ObSpinLockGuard guard(lock_); is_enabled_ = false; - ls_weak_read_ts_.set_min(); + // set weak read ts to 1 + ls_weak_read_ts_.set_base(); STORAGE_LOG(INFO, "weak read handler disabled", K(*this)); return ret; }