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
…ache#22153)

(cherry picked from commit 72cedb7)
(cherry picked from commit bbbd1ef)
  • Loading branch information
poorbarcode authored and mukesh-ctds committed Mar 4, 2024
1 parent f4f30cd commit 7fc96f9
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2688,14 +2688,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 @@ -2740,7 +2742,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 7fc96f9

Please sign in to comment.