[FIX] use write lock to reset calc_upper_trans_version_cache_ instead of read lock

This commit is contained in:
ZenoWang
2024-01-22 07:21:50 +00:00
committed by ob-robot
parent 3de97b1dd1
commit 2f1d042c88

View File

@ -1318,7 +1318,7 @@ void ObTxDataTable::disable_upper_trans_calculation()
{ {
ATOMIC_STORE(&calc_upper_trans_is_disabled_, true); ATOMIC_STORE(&calc_upper_trans_is_disabled_, true);
{ {
TCRLockGuard lock_guard(calc_upper_trans_version_cache_.lock_); TCWLockGuard lock_guard(calc_upper_trans_version_cache_.lock_);
calc_upper_trans_version_cache_.reset(); calc_upper_trans_version_cache_.reset();
} }
{ {
@ -1330,7 +1330,7 @@ void ObTxDataTable::disable_upper_trans_calculation()
void ObTxDataTable::enable_upper_trans_calculation(const share::SCN latest_transfer_scn) void ObTxDataTable::enable_upper_trans_calculation(const share::SCN latest_transfer_scn)
{ {
{ {
TCRLockGuard lock_guard(calc_upper_trans_version_cache_.lock_); TCWLockGuard lock_guard(calc_upper_trans_version_cache_.lock_);
calc_upper_trans_version_cache_.reset(); calc_upper_trans_version_cache_.reset();
} }
if (latest_transfer_scn_.is_valid()) { if (latest_transfer_scn_.is_valid()) {