dakshmehta007 opened a new pull request, #2825: URL: https://github.com/apache/kvrocks/pull/2825
### **Support Namespace in Pub/Sub Commands** (PR #2097 ) **Opened by @PragmaTwice on February 10, 2024** #### **Summary** This PR enhances Redis Pub/Sub commands by introducing namespace support. Previously, Pub/Sub mechanisms did not account for namespaces, which limited scalability in multi-tenant environments. This update ensures that channels respect namespace prefixes, providing proper tenant isolation and aligning Pub/Sub operations with Redis’s namespace-aware storage functionality. #### **Motivation** The lack of namespace compatibility in Pub/Sub commands makes multi-tenant implementations more complex. By enabling namespace support, this update allows better tenant segregation, improves security, and enhances integration with Redis’s existing namespace-based mechanisms. #### **Implementation Details** - Updated subscription and unsubscription methods (SubscribeChannel, UnsubscribeChannel, PSubscribeChannel, PUnsubscribeChannel, SSubscribeChannel, and SUnsubscribeChannel) to prepend namespace keys to channel names using ComposeNamespaceKey. - Improved tracking mechanisms to manage both namespaced and non-namespaced subscriptions. - Modified subscription lists (subscribe_channels_, subscribe_patterns_, and subscribe_shard_channels_) to store namespaced versions of subscribed channels. - Integrated namespace handling with Redis storage to ensure proper support for slot encoding when required. ### **Next Steps** - Verify compatibility of wildcard pattern subscriptions (PSUBSCRIBE) across different namespaces. - Add comprehensive test cases to validate namespace behavior in all Pub/Sub scenarios. -- 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]
