poorbarcode opened a new pull request, #16247:
URL: https://github.com/apache/pulsar/pull/16247
### Motivation
E.g. `TB.recover`, `topic.unload`, `lookup` executed at the same time:
| Time | `TB.recover` | `topic.unload` | `lookup-a` | `lookup-b` |
| ----------- | ----------- | ----------- | ----------- | ----------- |
| 1 | TB recover | | | |
| 2 | TB recover failure | topic.unload | | |
| 3 | topic.close | topic.close | | |
| 4 | brokerService.topics.remove(topicName) | | | |
| 5 | remove `topic` | | lookup | |
| 6 | | | create `topic'` | |
| 7 | | brokerService.topics.remove(topicName) | | |
| 8 | | remove `topic'` | | lookup |
| 9 | | | | create `topic''` |
In step 8:
- `topic'` removed from `broker-service-cache-mapping`, but it still exists
After step 9:
- we have two same topics: [`topic'`, `topic''`]
- `topic''` mapping in `broker-service-cache-mapping`
- `topic'` is not mapping in `broker-service-cache-mapping`, but it may be
used by the client.
We should remove “The specify Topic Refer” to prevent errors from concurrent
operations.
### Modifications
use `remove(key, value)` instead `remove(key)`.
### Documentation
Check the box below or label this PR directly.
Need to update docs?
- [ ] `doc-required`
(Your PR needs to update docs, and you will update later)
- [x] `doc-not-needed`
(Please explain why)
- [ ] `doc`
(Your PR contains doc changes)
- [ ] `doc-complete`
(Docs have been already added)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]