[Tiered Storage] Add logs for cleanup offloaded data operation
### 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.
@@ -2764,6 +2764,8 @@ public class ManagedLedgerImpl implements ManagedLedger, CreateCallback {
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,
@@ -2954,13 +2956,15 @@ public class ManagedLedgerImpl implements ManagedLedger, CreateCallback {
* 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);
}
});
}
