-
Notifications
You must be signed in to change notification settings - Fork 592
feat(cmd): add new command KMETADATA #2827
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@apache/kvrocks-committers What do you feel about this command proposal? |
|
@ltagliamonte-dd Could you please explain how the data returned by this command will be used for "SSTable sideloading"? Just to understand the flow. |
Sure thing @torwig, here more details: For example for hash data types (HSET Key subKey1 subKey1val1) there is a rocksdb row for the When writing to kvrocks there are 2 use cases:
This new CMD covers the update of an existing key. I'm still quite new to the decode/encode part of the project please let me know if my understanding is not correct. |
|
@git-hulk Could you please provide a link to the encoding schema? I can't find it :) |
|
@torwig thanks, since my use case is just HSET i've been focusing on this function https://github.com/apache/kvrocks/blob/unstable/src/types/redis_hash.cc#L241-L296 going over the code it looks like that when the key exists, metadata.version contains the current version of the Key hash. |
PragmaTwice
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can have a better name, GETXXX seems not so "Redis".
To avoid collision with future Redis commands, we can prefix with something like K or KVR, e.g. KMETADATA.
love KMETADATA! |
|
@torwig @git-hulk @PragmaTwice can i please get a CR on this? |
|
@ltagliamonte-dd Need to fix this flaky test which was introduced by this PR: https://github.com/apache/kvrocks/actions/runs/13964426962/job/39095603519?pr=2827#step:17:91 |
Fixed via c05654d |
|
@git-hulk @torwig @PragmaTwice can you please run the CI again it failed for a flaky test. |
|



Hello Folks,
To enable SSTable sideloading for Redis types that use versioning, retrieving the metadata.version is necessary when updating an existing key.
To support this, we've introduced a new command: KMETADATA, which returns the metadata for a given key.
Looking forward to your feedback!