From 7fe6bcdcc905d69c4182c3ca0dd5a462106afa23 Mon Sep 17 00:00:00 2001 From: zymap Date: Wed, 7 Sep 2022 20:27:28 +0800 Subject: [PATCH] log error when skip deleting --- .../bookkeeper/mledger/impl/ManagedLedgerImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 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 55ebda23daaf35..da754ec6ecb7bd 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 @@ -3004,14 +3004,18 @@ private void offloadLoop(CompletableFuture promise, Queue { if (exception != null) { - log.error("[{}] Failed to offload data for the ledgerId {}", - name, ledgerId, exception); - if (exception instanceof MetaStoreException) { + Throwable e = FutureUtil.unwrapCompletionException(exception); + if (e instanceof MetaStoreException) { // When a MetaStore exception happens, we can not make sure the metadata // update is failed or not. Because we have a retry on the connection loss, // it is possible to get a BadVersion or other exception after retrying. // So we don't clean up the data if it has metadata operation exception. + log.error("[{}] Failed to update offloaded metadata for the ledgerId {}", + name, ledgerId, exception); return; + } else { + log.error("[{}] Failed to offload data for the ledgerId {}", + name, ledgerId, exception); } cleanupOffloaded( ledgerId, uuid,