Skip to content

Commit

Permalink
fix(issue2108): avoid blocking at the end of a compaction iteration w…
Browse files Browse the repository at this point in the history
…hen there are un-uploaded data

Signed-off-by: Shichao Nie <[email protected]>
  • Loading branch information
SCNieh committed Nov 3, 2024
1 parent e9b2117 commit e494613
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -744,14 +744,16 @@ void executeCompactionPlans(CommitStreamSetObjectRequest request, List<Compactio
}
// wait for all stream objects and stream set object part to be uploaded
compactionCf = CompletableFuture.allOf(cfList.toArray(new CompletableFuture[0]))
.thenCompose(v -> uploader.forceUploadStreamSetObject())
.exceptionally(ex -> {
uploader.release().thenAccept(v -> {
for (CompactedObject compactedObject : compactionPlan.compactedObjects()) {
compactedObject.streamDataBlocks().forEach(StreamDataBlock::release);
}
}).join();
throw new IllegalStateException("Error while uploading compaction objects", ex);
.whenComplete((v, ex) -> {
uploader.forceUploadStreamSetObject();
if (ex != null) {
logger.error("Error while uploading compaction objects", ex);
uploader.release().thenAccept(vv -> {
for (CompactedObject compactedObject : compactionPlan.compactedObjects()) {
compactedObject.streamDataBlocks().forEach(StreamDataBlock::release);
}
}).join();
}
});
}
try {
Expand Down

0 comments on commit e494613

Please sign in to comment.