From 2dd86e7c8d986b1b8d2532bf555674da0a790fdd Mon Sep 17 00:00:00 2001 From: Vinoth Veeraraghavan Date: Fri, 4 Sep 2020 16:47:18 +0800 Subject: [PATCH] Fix select-for-update validation when pre_abort_validation is set to off --- .../concurrency_control/occ_transaction_manager.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/gausskernel/storage/mot/core/src/concurrency_control/occ_transaction_manager.cpp b/src/gausskernel/storage/mot/core/src/concurrency_control/occ_transaction_manager.cpp index b3a63b20f..504772e3f 100644 --- a/src/gausskernel/storage/mot/core/src/concurrency_control/occ_transaction_manager.cpp +++ b/src/gausskernel/storage/mot/core/src/concurrency_control/occ_transaction_manager.cpp @@ -264,13 +264,7 @@ RC OccTransactionManager::ValidateOcc(TxnManager* txMan) m_writeSetSize++; break; case RD: - if (txMan->GetTxnIsoLevel() > READ_COMMITED) { - readSetSize++; - if (m_preAbort && !QuickVersionCheck(ac)) { - rc = RC_ABORT; - goto final; - } - } + readSetSize++; break; default: break; @@ -291,8 +285,7 @@ RC OccTransactionManager::ValidateOcc(TxnManager* txMan) } // validate rows in the read set and write set - // for repeatable_read, no need to validate the read set. - if (txMan->GetTxnIsoLevel() > READ_COMMITED) { + if (readSetSize > 0) { if (!ValidateReadSet(txMan)) { rc = RC_ABORT; goto final;