-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Search before reporting
- I searched in the issues and found nothing similar.
Read release policy
- I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.
User environment
Apache pulsar 4.0.6, broker running on the same Ubuntu22 box. 2 clusters geo replicated .
Issue Description
When enabling 2-way geo replication on a pulsar cluster (clusterA) to replicate messages to a second cluster (clusterB) and clusterA has at least one topic accessed in exclusive mode by one producer, the second cluster (clusterB) doesn't replicate the messages to the first cluster (clusterA) and throws an error saying there is alredy a topic with exclusive access: the internal producer in charge of geo replication, clashes with the client app producer that has exclusive access.
Error messages
`pulsar-broker-ip-10-166-67-29.log:2025-10-28T17:41:00,261+0000 [pulsar-io-3-4] ERROR org.apache.pulsar.client.impl.ProducerImpl - [persistent://tn2/ns2/tpc2] [pulsar.repl.pulgeo2-->pulgeo1] Failed to create producer: {"errorMsg":"org.apache.pulsar.broker.service.BrokerServiceException$ProducerBusyException: Topic has an existing exclusive producer: pulgeo1-14-45","reqId":4267594562146349661, "remote":"ip-10-166-70-175.us-west-2.compute.internal/10.166.70.175:6650", "local":"/10.166.67.29:40330"}
pulsar-broker-ip-10-166-67-29.log:2025-10-28T17:41:00,261+0000 [pulsar-io-3-4] WARN org.apache.pulsar.broker.service.AbstractReplicator - [persistent://tn2/ns2/tpc2 | pulgeo2-->pulgeo1] Failed to create remote producer (org.apache.pulsar.client.api.PulsarClientException$ProducerBusyException: {"errorMsg":"org.apache.pulsar.broker.service.BrokerServiceException$ProducerBusyException: Topic has an existing exclusive producer: pulgeo1-14-45","reqId":4267594562146349661, "remote":"ip-10-166-70-175.us-west-2.compute.internal/10.166.70.175:6650", "local":"/10.166.67.29:40330"}), retrying in 24.743 s`
Reproducing the issue
this can be reproduced easily following the steps below:
- on clusterA: create a topic and start a producer application that accesses the topic in Exclusive or ExclusiveWithFencing mode: ".accessMode(ProducerAccessMode.Exclusive)"
- on clusterA: configure the namespace to be geo replicated to clusterB: "pa namespaces set-clusters --clusters=clusterA,clusterB"
- on clusterB: create the replicated namespace but don't establish the 2-way replication: "pa namespaces create --clusters=clusterB"
- on clusterB: verify that the messages produced by the exclusive producer are replicated to clusterB
- on clusterB: enable 2-way replication: "pa namespaces set-clusters --clusters=clusterA,clusterB" and verify that the error message is thrown in the broker logs.
- on clusterB: also verify that the topics stats show "connected=false" in the replication block.
Additional information
The expected behaviour is that geo replication allows the use of exclusive producers on the replicated topics. But the mechanics of geo replication involves the creation of internal producers that take care of geo replicating messages. These internal producers conflict with the exclusive producers of client application.
Are you willing to submit a PR?
- I'm willing to submit a PR!