Skip to content

Commit

Permalink
[fix] [ml] Fix retry mechanism of deleting ledgers to invalidate (apa…
Browse files Browse the repository at this point in the history
  • Loading branch information
poorbarcode authored and nodece committed Feb 23, 2024
1 parent 9e4328b commit cb8a5e3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3114,7 +3114,7 @@ private void offloadLoop(CompletableFuture<PositionImpl> promise, Queue<LedgerIn
.thenCompose(readHandle -> 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)
Expand Down Expand Up @@ -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) -> {
Expand Down

0 comments on commit cb8a5e3

Please sign in to comment.