<@U078Y59KC3B> under what circumstances would I ge...
# ask-ai
s
@RunLLM under what circumstances would I get the error
server error: ServiceNotReady: org.apache.pulsar.broker.service.BrokerServiceException$TopicFencedException: Topic is temporarily unavailable
? What should I do to resolve the issue?
r
You will see the error
server error: ServiceNotReady: org.apache.pulsar.broker.service.BrokerServiceException$TopicFencedException: Topic is temporarily unavailable
when a Pulsar topic is in a "fenced" or "temporarily unavailable" state. This can happen during topic unloads, broker restarts, BookKeeper failures, transaction buffer recovery failures, or race conditions in topic creation/deletion. The error means the topic is not ready to accept producers or consumers at that moment, often due to ongoing internal operations or errors in the broker or storage layer. According to Pulsar issue #21860, Pulsar issue #15451, and Pulsar PR #14801, this is a known issue in various Pulsar versions. To resolve the issue, you can: - Wait and retry the operation, as the topic may become available after the internal operation completes. - Restart the affected broker(s) if the topic remains fenced. - Ensure your Pulsar and BookKeeper clusters are healthy and running supported versions, as many related bugs have been fixed in recent releases. - If the problem persists, check broker logs for errors and consider upgrading Pulsar to a newer version with relevant bug fixes. Would you like more detail on the specific causes or troubleshooting steps? Sources: - Pulsar issue #21860 - Pulsar issue #15451 - Pulsar PR #14801 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
s
@RunLLM one of my bookkeeper nodes got restarted and even when the bookkeeper was back, I was still getting the error
server error: ServiceNotReady: org.apache.pulsar.broker.service.BrokerServiceException$TopicFencedException: Topic is temporarily unavailable
. Is there any command I can run on the broker to recover from the erroneous state without needing to restart the brokers?
r
There is no official Pulsar command to directly "unfence" a topic or recover it from the "temporarily unavailable" state without restarting the broker. This error can persist after a BookKeeper node restart due to race conditions or incomplete recovery, as discussed in Pulsar issue #21860 and Pulsar issue #15451. The most common workaround is to restart the affected broker, which clears the fenced state. Alternatively, you can try manually unloading the topic or its namespace bundle using the Pulsar admin CLI, which may force the broker to reload the topic and recover from the error:
Copy code
pulsar-admin topics unload persistent://tenant/namespace/topic
or
Copy code
pulsar-admin namespaces unload tenant/namespace
This does not guarantee recovery in all cases, but it is the only broker-side operation available without a full restart. Would you like more detail on why this happens or how unloading works? Sources: - Pulsar admin unload topic docs - Pulsar issue #21860 - Pulsar issue #15451 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.