[Bug] When querying a newly created topic with Pulsar SQL, the query will be blocked.
- 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.
### Version
master
### Minimal reproduce step
1. Create a new topic: `admin.topics().createPartitionedTopic(topic, 2);`
2. Query with `Pulsar-SQL`: `select * from pulsar."public/default"."topic1";`
### What did you expect to see?
Return an empty query result.
### What did you see instead?
The query will be blocked.
### Anything else?


The blocking happened here, line: 475
https://github.com/apache/pulsar/blob/001b134653b89103089b1429b9058d987cd0485c/managed-ledger/src/main/java/org/apache/bookkeeper/mledger/impl/ManagedLedgerFactoryImpl.java#L460-L476
Thread stack:
### 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.