sumitagrawl commented on code in PR #8781:
URL: https://github.com/apache/ozone/pull/8781#discussion_r2200968644


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/ha/SCMHADBTransactionBufferImpl.java:
##########
@@ -170,18 +205,18 @@ public void init() throws IOException {
     } finally {
       txFlushPending.set(0);
       lastSnapshotTimeMs = scm.getSystemClock().millis();
-      rwLock.writeLock().unlock();
+      releaseAllLocks();
     }
   }
   
   @Override
   public boolean shouldFlush(long snapshotWaitTime) {
-    rwLock.readLock().lock();
+    batchLock.readLock().lock();

Review Comment:
   even current code can not ensure this, for this, you need add check 
"shouldFlush()" inside the flush. and here also, this lock is not required in 
either case.
   It can not ensure as time to check and time to operate are different and not 
within lock.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to