add sanity check for cluster_version in TxCtx's checkpoint
This commit is contained in:
		| @ -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 { | ||||
|  | ||||
| @ -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(); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|  | ||||
| @ -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_; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 chinaxing
					chinaxing