forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Getting the stats of a non-persistent topic that has been cleaned cau…
…ses it to re-appear (apache#9029) If a non-persistent topic is unused it is automatically deleted by Pulsar. If you then get the stats on that topic name using the REST API, it causes that topic to re-appear. For example, a non-persistent topic `public/bob/np` exists in a namespace. It is returned when using the `admin/v2/non-persistent/public/bob` endpoint: ``` ["non-persistent://public/bob/np"] ``` Since this topic is unused, it gets cleaned and no longer is returned by the endpoint: ``` [] ``` However, if you request the stats for that topic using the CLI (which calls the REST API), like this, you actually get a response (not a 404): ``` bin/pulsar-admin topics stats non-persistent://public/bob/np Warning: Nashorn engine is planned to be removed from a future JDK release { "msgRateIn" : 0.0, "msgThroughputIn" : 0.0, "msgRateOut" : 0.0, "msgThroughputOut" : 0.0, "bytesInCounter" : 0, "msgInCounter" : 0, "bytesOutCounter" : 0, "msgOutCounter" : 0, "averageMsgSize" : 0.0, "msgChunkPublished" : false, "storageSize" : 0, "backlogSize" : 0, "publishers" : [ ], "subscriptions" : { }, "replication" : { } } ``` And now the topic re-appears on the topic-list endpoint: ``` ["non-persistent://public/bob/np"] ``` When loading a temporary topic with createIfMissing = false do not try to create it, simply return an empty value. Add test case. This change added tests and can be verified as in the bug description. Run: pulsar-admin topics create non-persistent://public/default/tmp wait for the topic to be deleted run pulsar-admin topics stats non-persistent://public/default/tmp
- Loading branch information
Showing
2 changed files
with
122 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters