-
Notifications
You must be signed in to change notification settings - Fork 955
Configurable DB hash seed for SCAN family commands consistency #2608
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
Configurable DB hash seed for SCAN family commands consistency #2608
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #2608 +/- ##
============================================
+ Coverage 72.39% 72.43% +0.03%
============================================
Files 128 128
Lines 70245 70261 +16
============================================
+ Hits 50853 50891 +38
+ Misses 19392 19370 -22
🚀 New features to boost your workflow:
|
927c6f7 to
a646578
Compare
09851f9 to
0cb4b64
Compare
b8ad08a to
f0bccf7
Compare
491c7bd to
a0dcf78
Compare
a678a68 to
bd920ed
Compare
|
@madolson I think it's ready for review 🙂 |
6251bbf to
158b61b
Compare
|
@madolson thanks for the review, I think I have addressed all the comments! |
madolson
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.
Looks closer, just some more minor comments.
cef6cc6 to
60752d4
Compare
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.
Sorry for the delay. Looks good in general, but I have a comment about the string-to-seed algorithm, which will becomes part of the interface, in the sense that if we change it in the future, it will break the scan cursor compatibility between nodes, so we may want think through this choice of algorithm.
Signed-off-by: Sarthak Aggarwal <[email protected]>
c4a109e to
5f0aa05
Compare
Signed-off-by: Sarthak Aggarwal <[email protected]>
5f0aa05 to
8960670
Compare
Signed-off-by: Sarthak Aggarwal <[email protected]>
zuiderkwast
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.
LGTM!
Co-authored-by: Viktor Söderqvist <[email protected]> Signed-off-by: Sarthak Aggarwal <[email protected]>
Signed-off-by: Sarthak Aggarwal <[email protected]>
|
Should we mention this config on the documentation page for SCAN? |
|
@zuiderkwast I also had this question. But when do we actually add the documentation, since the change is only in unstable and not released. |
We typically formulate things like this as "Starting with Valkey 9.1, it's possible to bla-bla-bla", because we want the docs to be useful regardless of which version a user is running, so we can add it any time once it's in unstable. |
|
sure, makes sense. If people agree that we should add it, I will raise a PR asap. |
|
Yeah I think it'd be good to have. Maybe under this section? https://valkey.io/commands/scan/#scan-guarantees We only need to add it for SCAN, since the other ones |
…y-io#2608) Introduce a new config `hash-seed` which can be set only at startup and controls the hash seed for the server. This includes all hash tables. This change makes it so that both primaries and replicas will return the same results for SCAN/HSCAN/ZSCAN/SSCAN cursors. This is useful in order to make sure SCAN behaves correctly after a failover. Resolves valkey-io#4 --------- Signed-off-by: Sarthak Aggarwal <[email protected]> Signed-off-by: Sarthak Aggarwal <[email protected]> Co-authored-by: Viktor Söderqvist <[email protected]>
Related to valkey-io/valkey#2608 Signed-off-by: Sarthak Aggarwal <[email protected]>
…y-io#2608) Introduce a new config `hash-seed` which can be set only at startup and controls the hash seed for the server. This includes all hash tables. This change makes it so that both primaries and replicas will return the same results for SCAN/HSCAN/ZSCAN/SSCAN cursors. This is useful in order to make sure SCAN behaves correctly after a failover. Resolves valkey-io#4 --------- Signed-off-by: Sarthak Aggarwal <[email protected]> Signed-off-by: Sarthak Aggarwal <[email protected]> Co-authored-by: Viktor Söderqvist <[email protected]>
…y-io#2608) Introduce a new config `hash-seed` which can be set only at startup and controls the hash seed for the server. This includes all hash tables. This change makes it so that both primaries and replicas will return the same results for SCAN/HSCAN/ZSCAN/SSCAN cursors. This is useful in order to make sure SCAN behaves correctly after a failover. Resolves valkey-io#4 --------- Signed-off-by: Sarthak Aggarwal <[email protected]> Signed-off-by: Sarthak Aggarwal <[email protected]> Co-authored-by: Viktor Söderqvist <[email protected]>
…y-io#2608) Introduce a new config `hash-seed` which can be set only at startup and controls the hash seed for the server. This includes all hash tables. This change makes it so that both primaries and replicas will return the same results for SCAN/HSCAN/ZSCAN/SSCAN cursors. This is useful in order to make sure SCAN behaves correctly after a failover. Resolves valkey-io#4 --------- Signed-off-by: Sarthak Aggarwal <[email protected]> Signed-off-by: Sarthak Aggarwal <[email protected]> Co-authored-by: Viktor Söderqvist <[email protected]>
…y-io#2608) Introduce a new config `hash-seed` which can be set only at startup and controls the hash seed for the server. This includes all hash tables. This change makes it so that both primaries and replicas will return the same results for SCAN/HSCAN/ZSCAN/SSCAN cursors. This is useful in order to make sure SCAN behaves correctly after a failover. Resolves valkey-io#4 --------- Signed-off-by: Sarthak Aggarwal <[email protected]> Signed-off-by: Sarthak Aggarwal <[email protected]> Co-authored-by: Viktor Söderqvist <[email protected]>
…y-io#2608) Introduce a new config `hash-seed` which can be set only at startup and controls the hash seed for the server. This includes all hash tables. This change makes it so that both primaries and replicas will return the same results for SCAN/HSCAN/ZSCAN/SSCAN cursors. This is useful in order to make sure SCAN behaves correctly after a failover. Resolves valkey-io#4 --------- Signed-off-by: Sarthak Aggarwal <[email protected]> Signed-off-by: Sarthak Aggarwal <[email protected]> Co-authored-by: Viktor Söderqvist <[email protected]>
Introduce a new config
hash-seedwhich can be set only at startup and controls the hash seed for the server. This includes all hash tables. This change makes it so that both primaries and replicas will return the same results for SCAN/HSCAN/ZSCAN/SSCAN cursors. This is useful in order to make sure SCAN behaves correctly after a failover.Resolves #4