poorbarcode commented on code in PR #18437:
URL: https://github.com/apache/pulsar/pull/18437#discussion_r1026153145


##########
pulsar-transaction/coordinator/src/test/java/org/apache/pulsar/transaction/coordinator/MLTransactionMetadataStoreTest.java:
##########
@@ -181,6 +185,18 @@ public void testRecoverSequenceId(boolean 
isUseManagedLedgerProperties) throws E
         transactionMetadataStore.init(new 
TransactionRecoverTrackerImpl()).get();
 
         Awaitility.await().until(transactionMetadataStore::checkIfReady);
+        if (isUseManagedLedgerProperties) {
+            //Mock a rateLimiter to avoid the internalMarkDelete call 
onCursorMarkDeletePositionUpdated
+            Field cursorField = 
MLTransactionLogImpl.class.getDeclaredField("cursor");
+            cursorField.setAccessible(true);
+            ManagedCursor cursor = (ManagedCursor) 
cursorField.get(mlTransactionLog);
+            Field rateLimiterFiled = 
ManagedCursorImpl.class.getDeclaredField("markDeleteLimiter");
+            rateLimiterFiled.setAccessible(true);
+
+            RateLimiter rateLimiter = mock(RateLimiter.class);
+            doReturn(false).when(rateLimiter).tryAcquire();
+            rateLimiterFiled.set(cursor, rateLimiter);
+        }

Review Comment:
   We can just ensure the new ledger has been created instead of the old ledger 
has been deleted, so we can avoid this new logic which avoids mark delete. 
@congbobo184  How are you feeling?



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