Skip to content

Commit

Permalink
[fix] [broker] print non log when delete partitioned topic failed (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
poorbarcode authored and Technoboy- committed Feb 29, 2024
1 parent 0fedaf7 commit 991068f
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2918,14 +2918,16 @@ public void checkGC() {

replCloseFuture.thenCompose(v -> delete(deleteMode == InactiveTopicDeleteMode.delete_when_no_subscriptions,
deleteMode == InactiveTopicDeleteMode.delete_when_subscriptions_caught_up, false))
.thenApply((res) -> tryToDeletePartitionedMetadata())
.thenCompose((res) -> tryToDeletePartitionedMetadata())
.thenRun(() -> log.info("[{}] Topic deleted successfully due to inactivity", topic))
.exceptionally(e -> {
if (e.getCause() instanceof TopicBusyException) {
// topic became active again
if (log.isDebugEnabled()) {
log.debug("[{}] Did not delete busy topic: {}", topic, e.getCause().getMessage());
}
} else if (e.getCause() instanceof UnsupportedOperationException) {
log.info("[{}] Skip to delete partitioned topic: {}", topic, e.getCause().getMessage());
} else {
log.warn("[{}] Inactive topic deletion failed", topic, e);
}
Expand Down Expand Up @@ -2970,7 +2972,7 @@ private CompletableFuture<Void> tryToDeletePartitionedMetadata() {
.filter(topicExist -> topicExist)
.findAny();
if (anyExistPartition.isPresent()) {
log.error("[{}] Delete topic metadata failed because"
log.info("[{}] Delete topic metadata failed because"
+ " another partition exist.", topicName);
throw new UnsupportedOperationException(
String.format("Another partition exists for [%s].",
Expand Down

0 comments on commit 991068f

Please sign in to comment.