Skip to content

Commit

Permalink
[fix] [broker] print non log when delete partitioned topic failed (ap…
Browse files Browse the repository at this point in the history
  • Loading branch information
poorbarcode authored Feb 29, 2024
1 parent c7cedc6 commit 72cedb7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2968,14 +2968,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 @@ -3020,7 +3022,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 72cedb7

Please sign in to comment.