From 645d31810ee03099d1bd08111cf312bbae520dc4 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 (cherry picked from commit 1967a9309586286580ac0f3b75a34e1f70e63f75) --- .../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 03484b58726e5..3977c2ba2b231 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 @@ -1828,7 +1828,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 d0f2788c9c59c..20bdbe4effc1c 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 @@ -3002,7 +3002,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); }