Persistent topic is always temporarily unavailable
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 142
Description
**Describe the bug**
Here is the error log at broker side:
```
23:29:38.178 [pulsar-io-22-19] WARN org.apache.pulsar.broker.service.ServerCnx - [/10.1.1.101:54749][persistent://swap_okex_prod/order_event/66][SUB_PP_EXCHANGE] Failed to create consumer: Topic is temporarily unavailable
java.util.concurrent.CompletionException: org.apache.pulsar.broker.service.BrokerServiceException$TopicFencedException: Topic is temporarily unavailable
at java.util.concurrent.CompletableFuture.encodeRelay(CompletableFuture.java:326) ~[?:1.8.0_121]
at java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:984) ~[?:1.8.0_121]
at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2124) ~[?:1.8.0_121]
at org.apache.pulsar.broker.service.ServerCnx.lambda$null$13(ServerCnx.java:680) ~[org.apache.pulsar-pulsar-broker-2.4.1.jar:2.4.1]
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602) ~[?:1.8.0_121]
at java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:614) ~[?:1.8.0_121]
at java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:1983) ~[?:1.8.0_121]
at org.apache.pulsar.broker.service.ServerCnx.lambda$handleSubscribe$15(ServerCnx.java:633) ~[org.apache.pulsar-pulsar-broker-2.4.1.jar:2.4.1]
at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602) [?:1.8.0_121]
at java.util.concurrent.CompletableFuture.uniApplyStage(CompletableFuture.java:614) [?:1.8.0_121]
at java.util.concurrent.CompletableFuture.thenApply(CompletableFuture.java:1983) [?:1.8.0_121]
at org.apache.pulsar.broker.service.ServerCnx.handleSubscribe(ServerCnx.java:622) [org.apache.pulsar-pulsar-broker-2.4.1.jar:2.4.1]
at org.apache.pulsar.common.protocol.PulsarDecoder.channelRead(PulsarDecoder.java:199) [org.apache.pulsar-pulsar-common-2.4.1.jar:2.4.1]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [io.netty-netty-all-4.1.32.Final.jar:4.1.32.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [io.netty-netty-all-4.1.32.Final.jar:4.1.32.Final]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [io.netty-netty-all-4.1.32.Final.jar:4.1.32.Final]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:323) [io.netty-netty-all-4.1.32.Final.jar:4.1.32.Final]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:297) [io.netty-netty-all-4.1.32.Final.jar:4.1.32.Final]
23:29:48.235 [ForkJoinPool.commonPool-worker-7] WARN org.apache.pulsar.broker.service.persistent.PersistentTopic - [persistent://swap_okex_prod/order_event/66] Attempting to add producer to a fenced topic
23:29:48.235 [ForkJoinPool.commonPool-worker-7] ERROR org.apache.pulsar.broker.service.ServerCnx - [/10.1.1.97:39705] Failed to add producer to topic persistent://swap_okex_prod/order_event/66: Topic is temporarily unavailable
```
**To Reproduce**
Difficult to reproduce
Contributor guide
Research direction
Start with the broker service entry points ServerCnx.handleSubscribe and PersistentTopic, using the reported stack trace and fenced-topic warnings as the initial trail. Investigate why the persistent topic remains fenced and unavailable, though reproduction is currently difficult. Done means the cause is identified and the reported subscribe and producer failures no longer leave the topic unavailable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100