[pulsar-broker] Fix: Topic loading fails without any error when replicator init fails
@@ -252,8 +252,12 @@ public class PersistentTopic extends AbstractTopic
if (cursor.getName().startsWith(replicatorPrefix)) {
String localCluster = brokerService.pulsar().getConfiguration().getClusterName();
String remoteCluster = PersistentReplicator.getRemoteCluster(cursor.getName());
- boolean isReplicatorStarted = addReplicationCluster(remoteCluster,
- this, cursor.getName(), localCluster);
+ boolean isReplicatorStarted = false;
+ try {
+ isReplicatorStarted = addReplicationCluster(remoteCluster, this, cursor.getName(), localCluster);
+ } catch (Exception e) {
+ log.warn("[{}] failed to start replication", topic, e);
+ }
if (!isReplicatorStarted) {
throw new NamingException(
PersistentTopic.this.getName() + " Failed to start replicator " + remoteCluster);
