priyeshkaratha commented on code in PR #11188:
URL: https://github.com/apache/ozone/pull/11188#discussion_r3954391409
##########
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestSCMHATransactionBufferMonitorTask.java:
##########
@@ -272,4 +288,122 @@ public void
testMonitorTaskDoesNotPartialFlushDuringTransactionApply()
assertEquals(ByteString.copyFromUtf8("value"),
statefulServiceConfigTable.get("key"));
}
+
+ /**
+ * Verifies that {@link SCMHADBTransactionBuffer#lock()} establishes mutual
exclusion with
+ * {@link SCMHADBTransactionBufferImpl#flush()}'s write lock (HDDS-16145).
+ */
+ @Test
+ public void testLockBlocksConcurrentFlush() throws Exception {
+ transactionBuffer.updateLatestTrxInfo(TRX_INFO_T4);
+ transactionBuffer.flush();
+
+ transactionBuffer.lock();
Review Comment:
Wrapped testLockBlocksConcurrentFlush's lock/unlock in try/finally
(restructured minimally so it unlocks exactly once).
--
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]