From cc6ad008979f838f042fb2d05bd0d02126d03bb2 Mon Sep 17 00:00:00 2001 From: KyrielightWei Date: Tue, 8 Oct 2024 13:46:15 +0000 Subject: [PATCH] master placeholder : duplicate table modified --- src/storage/tx/ob_trans_define_v4.cpp | 2 +- src/storage/tx/ob_trans_define_v4.h | 28 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/storage/tx/ob_trans_define_v4.cpp b/src/storage/tx/ob_trans_define_v4.cpp index 44821c066..35ba1fef4 100644 --- a/src/storage/tx/ob_trans_define_v4.cpp +++ b/src/storage/tx/ob_trans_define_v4.cpp @@ -280,7 +280,7 @@ void ObTxReadSnapshot::convert_to_out_tx() core_.scn_.reset(); } -OB_SERIALIZE_MEMBER(ObTxPart, id_, addr_, epoch_, first_scn_, last_scn_); +OB_SERIALIZE_MEMBER(ObTxPart, id_, addr_, epoch_, first_scn_, last_scn_, flag_.flag_val_); DEFINE_SERIALIZE(ObTxDesc::FLAG::FOR_FIXED_SER_VAL) { diff --git a/src/storage/tx/ob_trans_define_v4.h b/src/storage/tx/ob_trans_define_v4.h index 467e75b59..76975dae7 100644 --- a/src/storage/tx/ob_trans_define_v4.h +++ b/src/storage/tx/ob_trans_define_v4.h @@ -207,6 +207,33 @@ struct ObTxParam OB_UNIS_VERSION(1); }; +union ObTxPartFlag +{ + int64_t flag_val_; + struct FlagBit + { + unsigned int is_dup_ls_ : 1; + + FlagBit() { reset(); } + + void reset() { is_dup_ls_ = 0; } + + TO_STRING_KV(K(is_dup_ls_)); + + } flag_bit_; + + ObTxPartFlag() { reset(); } + + void reset() + { + flag_val_ = 0; + flag_bit_.reset(); + } + + bool is_dup_ls() const { return flag_bit_.is_dup_ls_ == 1; } + void set_dup_ls() { flag_bit_.is_dup_ls_ = 1; } +}; + struct ObTxPart { static const int64_t EPOCH_UNKNOWN = -1; @@ -219,6 +246,7 @@ struct ObTxPart ObTxSEQ first_scn_; // used to judge a ctx is clean in scheduler view ObTxSEQ last_scn_; // used to get rollback savepoint set int64_t last_touch_ts_; // used to judge a ctx retouched after a time point + ObTxPartFlag flag_; // used to describe some special attributes of a participant bool operator==(const ObTxPart &rhs) const { return id_ == rhs.id_ && addr_ == rhs.addr_; } bool operator!=(const ObTxPart &rhs) const { return !operator==(rhs); } bool is_clean() const { return !first_scn_.is_valid() || (first_scn_ > last_scn_); }