Pub/Sub doesn't take namespace into account
- Dominant language
- C++
- Stars
- 4.4k
- Forks
- 658
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 10
Description
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/incubator-kvrocks/issues) and found no similar issues.
### Version
Latest from the `unstable` branch, Fedora 35.
### Minimal reproduce step
Run `kvrocks` with additional two namespaces, e.g.
```
namespace.one password4one
namespace.two password4two
```
Run two `redisc-cli` instances, and connect to `kvrocks`.
Switch to the first namespace via the first `redis-cli`: `auth password4one`.
Switch to the second namespace via the second `redis-cli`: `auth password4two`.
Execute `subscribe channel` via the second `redisc-cli`.
Execute `publish channel not-for-second-ns` via the first `redis-cli`.
### What did you expect to see?
The message, published in `namespace.one` should not be received by the subscribers in `namespace.two`, even if the channel names are the same.
### What did you see instead?
Subscribers from `namespace.two` received the message, published in `namespace.one`.
For Pub/Sub namespaces aren't isolated.
### Anything Else?
_No response_
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the issue with two configured namespaces and separate redis-cli sessions, then trace the Pub/Sub subscription and publication paths alongside authentication and namespace handling. Done means a message published in one namespace is not delivered to subscribers in another, while same-namespace delivery still works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, redis
- Domain
- databases, distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100