manojpec commented on a change in pull request #4363:
URL: https://github.com/apache/hudi/pull/4363#discussion_r771776738



##########
File path: 
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/transaction/TransactionManager.java
##########
@@ -55,28 +55,32 @@ public void beginTransaction() {
 
   public void beginTransaction(Option<HoodieInstant> currentTxnOwnerInstant,
                                Option<HoodieInstant> 
lastCompletedTxnOwnerInstant) {
-    if (supportsOptimisticConcurrency) {
+    if (isOptimisticConcurrencyControlEnabled) {
       LOG.info("Transaction starting for " + currentTxnOwnerInstant
           + "with latest completed transaction instant " + 
lastCompletedTxnOwnerInstant);
       lockManager.lock();
-      this.currentTxnOwnerInstant = currentTxnOwnerInstant;
-      this.lastCompletedTxnOwnerInstant = lastCompletedTxnOwnerInstant;
+      reset(currentTxnOwnerInstant, lastCompletedTxnOwnerInstant);
       LOG.info("Transaction started for " + currentTxnOwnerInstant
           + "with latest completed transaction instant " + 
lastCompletedTxnOwnerInstant);
     }
   }
 
   public void endTransaction() {
-    if (supportsOptimisticConcurrency) {
+    if (isOptimisticConcurrencyControlEnabled) {

Review comment:
       Good catch, will close the gap in the reset with CAS like operation. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to