[Bug] [broker] Non persistent topic will be lost when it is unloaded.
- 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.

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`

### 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
Assessment
This issue has not been assessed yet.