Skip to content

Commit

Permalink
[Tiered Storage] Add logs for cleanup offloaded data operation (apach…
Browse files Browse the repository at this point in the history
…e#9852)

### Motivation

The cleanup offloaded data operation was lack of logs, it's hard for users to analyze the tiered storage data loss reason.

### Modifications

Add some logs for the cleanup offloaded data operation.
  • Loading branch information
gaoran10 authored Mar 11, 2021
1 parent 7f92ade commit 3120a4b
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2764,6 +2764,8 @@ 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);
cleanupOffloaded(
ledgerId, uuid,
driverName, driverMetadata,
Expand Down Expand Up @@ -2954,13 +2956,15 @@ private void cleanupOffloaded(long ledgerId, UUID uuid, String offloadDriverName
* identify offloader
*/
Map<String, String> offloadDriverMetadata, String cleanupReason) {
log.info("[{}] Cleanup offload for ledgerId {} uuid {} because of the reason {}.",
name, ledgerId, uuid.toString(), cleanupReason);
Retries.run(Backoff.exponentialJittered(TimeUnit.SECONDS.toMillis(1), TimeUnit.SECONDS.toHours(1)).limit(10),
Retries.NonFatalPredicate,
() -> config.getLedgerOffloader().deleteOffloaded(ledgerId, uuid, offloadDriverMetadata),
scheduledExecutor, name).whenComplete((ignored, exception) -> {
if (exception != null) {
log.warn("Error cleaning up offload for {}, (cleanup reason: {})", ledgerId, cleanupReason,
exception);
log.warn("[{}] Error cleaning up offload for {}, (cleanup reason: {})",
name, ledgerId, cleanupReason, exception);
}
});
}
Expand Down

0 comments on commit 3120a4b

Please sign in to comment.