diff --git a/src/storage/tx/ob_trans_part_ctx.cpp b/src/storage/tx/ob_trans_part_ctx.cpp index f0902c044..47ec5d0c3 100644 --- a/src/storage/tx/ob_trans_part_ctx.cpp +++ b/src/storage/tx/ob_trans_part_ctx.cpp @@ -6333,7 +6333,11 @@ int ObPartTransCtx::get_tx_ctx_table_info_(ObTxCtxTableInfo &info) info.tx_id_ = trans_id_; info.ls_id_ = ls_id_; info.cluster_id_ = cluster_id_; - info.cluster_version_ = cluster_version_; + if (cluster_version_accurate_) { + info.cluster_version_ = cluster_version_; + } else { + info.cluster_version_ = 0; + } if (OB_FAIL(mt_ctx_.get_table_lock_store_info(info.table_lock_info_))) { TRANS_LOG(WARN, "get_table_lock_store_info failed", K(ret), K(info)); } else { diff --git a/src/storage/tx_table/ob_tx_table_define.cpp b/src/storage/tx_table/ob_tx_table_define.cpp index 4ceca807e..7d6e3c0cf 100644 --- a/src/storage/tx_table/ob_tx_table_define.cpp +++ b/src/storage/tx_table/ob_tx_table_define.cpp @@ -161,6 +161,10 @@ int ObTxCtxTableInfo::deserialize_(const char *buf, if (OB_SUCC(ret) && buf_len > pos) { // has remains, continue to deserialize new members if (OB_FAIL(serialization::decode_vi64(buf, buf_len, pos, &cluster_version_))) { TRANS_LOG(WARN, "dencode cluster_version fail", K(buf_len), K(pos), K(ret)); + } else if (cluster_version_ && cluster_version_ < CLUSTER_VERSION_4_2_0_0) { + ret = OB_ERR_UNEXPECTED; + TRANS_LOG(ERROR, "cluster version malformed", K(cluster_version_), KPC(this)); + ob_abort(); } } diff --git a/src/storage/tx_table/ob_tx_table_define.h b/src/storage/tx_table/ob_tx_table_define.h index fb58347b0..3152d1255 100644 --- a/src/storage/tx_table/ob_tx_table_define.h +++ b/src/storage/tx_table/ob_tx_table_define.h @@ -97,7 +97,8 @@ public: table_lock_info_.reset(); } void destroy() { reset(); } - TO_STRING_KV(K_(tx_id), K_(ls_id), K_(cluster_id), K_(tx_data_guard), K_(exec_info), K_(cluster_version)); + TO_STRING_KV(K_(tx_id), K_(ls_id), K_(cluster_id), K_(tx_data_guard), + K_(exec_info), K_(table_lock_info), K_(cluster_version)); transaction::ObTransID tx_id_; share::ObLSID ls_id_; int64_t cluster_id_;