From cb8a5e38fb65307a3b7f18048880b6d9153bed72 Mon Sep 17 00:00:00 2001 From: fengyubiao Date: Wed, 10 Jan 2024 07:31:04 +0800 Subject: [PATCH] [fix] [ml] Fix retry mechanism of deleting ledgers to invalidate (#21869) --- .../org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java index 35108fea1752c..c2239953c50fc 100644 --- a/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java +++ b/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerImpl.java @@ -3114,7 +3114,7 @@ private void offloadLoop(CompletableFuture promise, Queue config.getLedgerOffloader().offload(readHandle, uuid, extraMetadata)) .thenCompose((ignore) -> { return Retries.run(Backoff.exponentialJittered(TimeUnit.SECONDS.toMillis(1), - TimeUnit.SECONDS.toHours(1)).limit(10), + TimeUnit.HOURS.toMillis(1)).limit(10), FAIL_ON_CONFLICT, () -> completeLedgerInfoForOffloaded(ledgerId, uuid), scheduledExecutor, name) @@ -3337,7 +3337,7 @@ private void cleanupOffloaded(long ledgerId, UUID uuid, String offloadDriverName metadataMap.putAll(offloadDriverMetadata); metadataMap.put("ManagedLedgerName", name); - Retries.run(Backoff.exponentialJittered(TimeUnit.SECONDS.toMillis(1), TimeUnit.SECONDS.toHours(1)).limit(10), + Retries.run(Backoff.exponentialJittered(TimeUnit.SECONDS.toMillis(1), TimeUnit.HOURS.toMillis(1)).limit(10), Retries.NonFatalPredicate, () -> config.getLedgerOffloader().deleteOffloaded(ledgerId, uuid, metadataMap), scheduledExecutor, name).whenComplete((ignored, exception) -> {