master placeholder : duplicate table modified

This commit is contained in:
KyrielightWei 2024-10-08 13:46:15 +00:00 committed by ob-robot
parent 852263d74f
commit cc6ad00897
2 changed files with 29 additions and 1 deletions

View File

@ -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)
{

View File

@ -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_); }