apache / apache/pulsar

[Bug] [broker] Non persistent topic will be lost when it is unloaded.

Open
#23,029 0 comments 1 reaction 1 assignee Claimed by @hanmz View on GitHub
type/bug
Dominant language
Java
Stars
15.3k
Forks
3.8k
Avg merge
1d 14h
Merged PRs (30d)
160

Description

### Search before asking

- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.

### Read release policy

- [X] 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.

### Version

ALL

### Minimal reproduce step

1. Start a pulsar broker.
2. Create a non persistent topic, for example `non-persistent://test-tenant/test-ns/test-topic`
3. Execute admin command: `sh bin/pulsar-admin topics list test-tenant/test-ns`, we will see this topic.
![image](https://github.com/user-attachments/assets/4cfab7f7-f3a8-4ed5-b8b5-0dd10d1c75cb)
4. Execute admin command: `sh bin/pulsar-admin topics unload non-persistent://test-tenant/test-ns/test-topic`, we won't be able to see this topic.
5. At this time, we execute the admin command: `sh bin/pulsar-admin topics stats non-persistent://test-tenant/test-ns/test-topic`. We will see the error log: `Topic non-persistent://test-tenant/test-ns/test-topic not found`
![image](https://github.com/user-attachments/assets/5547d0c3-5042-4734-8917-9006d9073c1a)

### What did you expect to see?

The topic should still exist when we unload.

### What did you see instead?

The topic will be lost when it is unloaded.

### Anything else?

If it is a partition topic, it can be re-created after unload it (whether the allowAutoTopicCreation switch is turned on or not). However, non-partition topics cannot be created if the switch for allowAutoTopicCreation is not turned on.

### Are you willing to submit a PR?

- [X] I'm willing to submit a PR!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.