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 heesung-sn committed Feb 29, 2024
1 parent ca35b2e commit bc13b44
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2674,14 +2674,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 @@ -2726,7 +2728,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 bc13b44

Please sign in to comment.