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


##########
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:
   batchLock earlier was only protecting flush earlier. I guess this was added 
to ensure flush gets serialized and we don't end up doing frequent flushes in 
corner cases where flush was happening when this flush happens which might end 
up triggering a wasteful flush again.



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