codelipenghui commented on code in PR #17677:
URL: https://github.com/apache/pulsar/pull/17677#discussion_r1051953582


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/delayed/bucket/BookkeeperBucketSnapshotStorage.java:
##########
@@ -61,7 +61,11 @@ public CompletableFuture<Long> 
createBucketSnapshot(SnapshotMetadata snapshotMet
                 .thenCompose(ledgerHandle -> addEntry(ledgerHandle, 
snapshotMetadata.toByteArray())
                         .thenCompose(__ -> addSnapshotSegments(ledgerHandle, 
bucketSnapshotSegments))
                         .thenCompose(__ -> closeLedger(ledgerHandle))
-                        .thenApply(__ -> ledgerHandle.getId()));
+                        .thenApply(__ -> 
ledgerHandle.getId()).whenComplete((ledgerId, ex) -> {

Review Comment:
   If we add the exception handing to the end of the chain. Do we need to check 
the exception types? If it just failed to close the Ledger, we don't need to 
remove the ledger or just the Ledger creation failed.
   
   Or we can just add exception handling for `addEntry()` method?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to