diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactedTopicImpl.java b/pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactedTopicImpl.java index 8794e2736d4d4..0c074d70e44dc 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactedTopicImpl.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/compaction/CompactedTopicImpl.java @@ -238,7 +238,7 @@ private static CompletableFuture readOneMessageId(LedgerHandle lh private static CompletableFuture openCompactedLedger(BookKeeper bk, long id) { CompletableFuture promise = new CompletableFuture<>(); - bk.asyncOpenLedger(id, + bk.asyncOpenLedgerNoRecovery(id, Compactor.COMPACTED_TOPIC_LEDGER_DIGEST_TYPE, Compactor.COMPACTED_TOPIC_LEDGER_PASSWORD, (rc, ledger, ctx) -> { diff --git a/pulsar-broker/src/test/java/org/apache/pulsar/compaction/CompactedTopicTest.java b/pulsar-broker/src/test/java/org/apache/pulsar/compaction/CompactedTopicTest.java index e955a433ad5e1..8051b439b700c 100644 --- a/pulsar-broker/src/test/java/org/apache/pulsar/compaction/CompactedTopicTest.java +++ b/pulsar-broker/src/test/java/org/apache/pulsar/compaction/CompactedTopicTest.java @@ -855,7 +855,7 @@ public void testCompactWithConcurrentGetCompactionHorizonAndCompactedTopicContex Thread.sleep(1500); invocation.callRealMethod(); return null; - }).when(bk).asyncOpenLedger(Mockito.anyLong(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); + }).when(bk).asyncOpenLedgerNoRecovery(Mockito.anyLong(), Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any()); LedgerHandle oldCompactedLedger = bk.createLedger(1, 1, Compactor.COMPACTED_TOPIC_LEDGER_DIGEST_TYPE,