[tx-route] fix extra state isolation field verify failed

This commit is contained in:
chinaxing
2024-04-12 07:51:27 +00:00
committed by ob-robot
parent 99cdba0e79
commit 0e3a5dede9
2 changed files with 18 additions and 3 deletions

View File

@ -21,6 +21,15 @@ namespace transaction {
FLAG flags_ = { .v_ = 0 }; \
bool can_elr_ = false; \
int abort_cause_ = 0;
// only serialize isolation_ when Repeatable Read or SERIALIZABLE
#define PRE_ENCODE_EXTRA_FOR_VERIFY \
ObTxIsolationLevel isolation_ = ObTxIsolationLevel::INVALID; \
if (this->isolation_ == ObTxIsolationLevel::RR \
|| this->isolation_ == ObTxIsolationLevel::SERIAL) { \
isolation_ = this->isolation_; \
}
#define PRE_STATIC_DECODE
#define POST_STATIC_DECODE
// bookkeep the original before update, then after receive the update,
@ -136,7 +145,7 @@ TXN_FREE_ROUTE_MEMBERS(parts,,,,
// the fields 'dup with static' are required when preceding of txn is of query like
// savepoint or read only stmt with isolation of SERIALIZABLE / REPEATABLE READ
// because such type of query caused the txn into 'start' in perspective of proxy
TXN_FREE_ROUTE_MEMBERS(extra, , PRE_EXTRA_DECODE, POST_EXTRA_DECODE,
TXN_FREE_ROUTE_MEMBERS(extra, PRE_ENCODE_EXTRA_FOR_VERIFY, PRE_EXTRA_DECODE, POST_EXTRA_DECODE,
tx_id_, // dup with static
sess_id_, // dup with static
addr_, // dup with static