lhotari commented on code in PR #22750: URL: https://github.com/apache/pulsar/pull/22750#discussion_r1607630036
########## pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java: ########## @@ -453,6 +461,37 @@ public CompletableFuture<Void> closeAsync() { } state = State.Closing; + // forcefully delete heartbeat topic when close broker + if (this.brokerService != null) { + LOG.info("forcefully delete heartbeat topic when close broker"); + NamespaceName namespaceNameV1 = + NamespaceService.getHeartbeatNamespace(getAdvertisedAddress(), getConfiguration()); + NamespaceName namespaceNameV2 = + NamespaceService.getHeartbeatNamespaceV2(getAdvertisedAddress(), getConfiguration()); + String heartbeatTopicNameV1 = String.format("persistent://%s/%s", namespaceNameV1, HEALTH_CHECK_TOPIC_SUFFIX); + String heartbeatTopicNameV2 = String.format("persistent://%s/%s", namespaceNameV2, HEALTH_CHECK_TOPIC_SUFFIX); Review Comment: Instead of duplicating this logic, it's worth extracting a method in https://github.com/apache/pulsar/blob/e4553391f96af3bda3d8252b97cac3de1f39a1b5/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java#L409-L413 so that the same logic can be shared for resolving the topic names. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org