You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "clickfreak (via GitHub)" <gi...@apache.org> on 2025/05/01 17:11:21 UTC

[I] Receive notification for SET and DEL events on replicas (minimal implementation of notify-keyspace-events) [kvrocks]

clickfreak opened a new issue, #2915:
URL: https://github.com/apache/kvrocks/issues/2915

   ### Search before asking
   
   - [x] I had searched in the [issues](https://github.com/apache/kvrocks/issues) and found no similar issues.
   
   
   ### Motivation
   
   Applications connected to the KVRocks read-only replica use their own cache to reduce response latency and minimize direct requests to KVRocks. However, the application must react to key changes in order to provide up-to-date responses.
   
   We don’t use TTLs for keys and don’t expect key expiration events — this is also difficult to implement due to the nature of the KVRocks underlying storage (rocksdb). As minimum we need to react on SET and DEL commands, apps itself can control the subscription using PSUBSCRIBE and PUNSUBSCRIBE commands, it will allow to replace Redis/Valkey with minimal effort.
   
   KVRocks is excellent for distributing data across the fleet without wasting RAM, and it’s a very strong candidate to replace our current Redis storage. Keyspace events are the last missing piece preventing us from fully switching from Redis/Valkey to KVRocks.
   
   
   ### Solution
   
   From what I understand, KVRocks uses a WAL internally to replicate changes. This means that when the WAL is applied on replicas, it should be possible to detect key changes and emit events to applications with subscriptions by pattern (PSUBSCRIBE/PUNSUBSCRIBE).
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
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: issues-unsubscribe@kvrocks.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Receive notification for SET and DEL events on replicas (minimal implementation of notify-keyspace-events) [kvrocks]

Posted by "jihuayu (via GitHub)" <gi...@apache.org>.
jihuayu commented on issue #2915:
URL: https://github.com/apache/kvrocks/issues/2915#issuecomment-4703690695

   Hi @Aetherance. Thank you for your attention. Kvrocks currently does not support Redis keyspace notifications. Your solution looks reasonable. However, it would be better if you first submit an overall proposal in the [GitHub Discussions page](https://github.com/apache/kvrocks/discussions). After we reach a clear agreement, we can proceed with the implementation, which can help avoid rework later. Thank you.


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Receive notification for SET and DEL events on replicas (minimal implementation of notify-keyspace-events) [kvrocks]

Posted by "Aetherance (via GitHub)" <gi...@apache.org>.
Aetherance commented on issue #2915:
URL: https://github.com/apache/kvrocks/issues/2915#issuecomment-4701009715

   Hi, I'd like to take this issue.
   
   I plan to implement the scope described here: emit notifications for SET and DEL events on replicas, integrated with the existing PSUBSCRIBE/PUNSUBSCRIBE behavior. I'll check the replication apply path and add tests for the externally observable behavior.
   
   If this sounds good, I'll start working on a PR.


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Receive notification for SET and DEL events on replicas (minimal implementation of notify-keyspace-events) [kvrocks]

Posted by "Aetherance (via GitHub)" <gi...@apache.org>.
Aetherance commented on issue #2915:
URL: https://github.com/apache/kvrocks/issues/2915#issuecomment-4757174074

   Hi @jihuayu , I’ve finished a proposal in #3533. Could you please take a look when you have time?


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Receive notification for SET and DEL events on replicas (minimal implementation of notify-keyspace-events) [kvrocks]

Posted by "PragmaTwice (via GitHub)" <gi...@apache.org>.
PragmaTwice commented on issue #2915:
URL: https://github.com/apache/kvrocks/issues/2915#issuecomment-2846184356

   Yeah we didn't support keyspace notification now (https://redis.io/docs/latest/develop/use/keyspace-notifications/).
   
   Maybe it could be an OSPP project. cc @git-hulk 


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Receive notification for SET and DEL events on replicas (minimal implementation of notify-keyspace-events) [kvrocks]

Posted by "Aetherance (via GitHub)" <gi...@apache.org>.
Aetherance commented on issue #2915:
URL: https://github.com/apache/kvrocks/issues/2915#issuecomment-4705475167

   Hi @jihuayu , thanks for the guidance. I'll write up an overall proposal and post it in GitHub Discussions once it's ready. Thanks!


-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org