From 1967a9309586286580ac0f3b75a34e1f70e63f75 Mon Sep 17 00:00:00 2001 From: hrzzzz <64506104+hrzzzz@users.noreply.github.com> Date: Sat, 21 Dec 2024 21:32:32 +0800 Subject: [PATCH] [fix][broker] System topic should not be migrated during blue-green cluster migration (#23767) Co-authored-by: ruihongzhou --- .../java/org/apache/pulsar/broker/service/BrokerService.java | 4 +++- .../pulsar/broker/service/persistent/PersistentTopic.java | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java index 6afa1ae32fbcb..c79d839097e68 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java @@ -1888,7 +1888,9 @@ public void openLedgerFailed(ManagedLedgerException exception, Object ctx) { } private CompletableFuture checkTopicAlreadyMigrated(TopicName topicName) { - if (ExtensibleLoadManagerImpl.isInternalTopic(topicName.toString())) { + if (ExtensibleLoadManagerImpl.isInternalTopic(topicName.toString()) + || SystemTopicNames.isEventSystemTopic(topicName) + || NamespaceService.isHeartbeatNamespace(topicName.getNamespaceObject())) { return CompletableFuture.completedFuture(null); } CompletableFuture result = new CompletableFuture<>(); diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java index 11220d1c955e3..f6fe1a2f8de4d 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java @@ -2926,7 +2926,10 @@ private boolean hasBacklogs(boolean getPreciseBacklog) { @Override public CompletableFuture checkClusterMigration() { - if (ExtensibleLoadManagerImpl.isInternalTopic(topic)) { + TopicName topicName = TopicName.get(topic); + if (ExtensibleLoadManagerImpl.isInternalTopic(topic) + || isEventSystemTopic(topicName) + || NamespaceService.isHeartbeatNamespace(topicName.getNamespaceObject())) { return CompletableFuture.completedFuture(null); }