Skip to content

Commit

Permalink
log error when skip deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
zymap committed Sep 7, 2022
1 parent 86900ec commit 7fe6bcd
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3004,14 +3004,18 @@ private void offloadLoop(CompletableFuture<PositionImpl> promise, Queue<LedgerIn
scheduledExecutor, name)
.whenComplete((ignore2, exception) -> {
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,
Expand Down

0 comments on commit 7fe6bcd

Please sign in to comment.