-
Notifications
You must be signed in to change notification settings - Fork 955
Implement: CLUSTER REPLICATE NO ONE #1674
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
Implement: CLUSTER REPLICATE NO ONE #1674
Conversation
91589d1 to
ff96c0f
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #1674 +/- ##
============================================
+ Coverage 71.00% 71.08% +0.08%
============================================
Files 123 123
Lines 65675 65704 +29
============================================
+ Hits 46631 46706 +75
+ Misses 19044 18998 -46
🚀 New features to boost your workflow:
|
hpatro
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.
cluster-replicate.json file should be updated and as part of the build commands.def will get updated. or if it was accidentally not staged, please add that.
Also, could you run the clang-format on your end to fix some of the formatting issue.
fde1ab6 to
4abbae8
Compare
Updated. |
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.
This feature makes sense to me.
@valkey-io/core-team New arguments = major decision. Please approve or vote if you agree.
4abbae8 to
85238e6
Compare
|
The CI job "DCO" is failing. You need to use Why we need it? See here: https://github.com/valkey-io/valkey/blob/unstable/CONTRIBUTING.md#developer-certificate-of-origin thanks! |
85238e6 to
3789227
Compare
3789227 to
e4e8b24
Compare
Done |
e4e8b24 to
bed392b
Compare
|
Any objection to merge it? |
|
We're busy making the 8.1.0 release candidate just now. This one will need to wait and get merged after that. |
We should also have some tests validating this new behavior works as intended. Have a cluster, disconnect the replica, make sure slots/shards and all are still consistent and the rest of the cluster agrees on the state. |
Can we introduce a new mode so it doesn't forget all the nodes in the cluster? I think conceptually we are discussing a form of reset still so it seems to me that the solution is too tactical. Maybe BTW, I just noticed that the forget path is not always working. The reset node joined back to the cluster quickly.
I don't see the implementation moves the node to a new shard. This would leave two primaries (one real and one empty) in the original shard, which will confuse the client. |
Good catch! |
IMHO that is just a syntactical question. Whatever command name we would come up with, the behavior of it would be the same: turn replica into primary with leaving it in the cluster. If you think the name of
What do you mean by "forget path is not always working"? What forget path? We are not doing any forgetting here.
AFAIU if node is reset it will not be added back to the cluster automatically, but only when somebody does it explicitly. So if you want to remove replica manually (i.e. node is scheduled for maintenance) the only option for you is to reset with affecting all clients (start seeing errors).
What is a shard? Would you please shed a light on this term? Is it something special for ValKey? AFAIU shard is primary with replicas attached to it. So, when we switched role of the node from replica to empty primary, doesn't it mean that we moved it to separate new shard? |
bed392b to
b419cfb
Compare
|
I believe I figured it out. There is internal |
b9ad4fd to
95c0b42
Compare
|
What is the next step? |
Wait for merge and release on Valkey 9 |
Actually, my question was related to the merging process. How should it be merged? Is it something I should do to make it happen? Merging button is still not available to me. |
|
When it is time to merge, Valkey maintainer will merge it for you, Do not worry @valkey-io/core-team |
a801680 to
7ce7224
Compare
64da23f to
dca695e
Compare
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.
We just need to update the version numbers to 9.0.0
8dcbbed to
0cf9db8
Compare
|
I think it's safe to merge @zuiderkwast and address any further comment in future (if any). Shall I go ahead? |
|
@hpatro I've been accused of YOLO-merging PRs before, when people were still reviewing. 😆 |
PingXie
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. Just a few minor suggestions. Thanks @skolosov-snap!
Signed-off-by: Sergey Kolosov <[email protected]>
3c4b996 to
ff4dc90
Compare
TBF, I'm fairly sure we've all done that. When I was at Kube-con I heard so many endless drama stories about dysfunctional projects where everyone was always mad at each other about code quality, sneaking changes without reviews, etc. By comparison people seem to think we are a highly functional group. |
Small correction 😀 |
|
@skolosov-snap Thanks for the PR. It's merged now 🥳 . Could you update the docs as well ? The repository for docs: https://github.com/valkey-io/valkey-doc/ |
Currently, Valkey doesn't allow to detach replica attached to primary node. So, if you want to change cluster topology the only way to do it is to reset (````CLUSTER RESET```` command) the node. However, this results into removing node from the cluster what affects clients. All clients will keep sending traffic to this node (with getting inaccurate responses) until they refresh their topology. In this change we implement supporting of new argument for CLUSTER REPLICATE command: ````CLUSTER REPLICATE NO ONE````. When calling this command the node will be converted from replica to empty primary node but still staying in the cluster. Thus, all traffic coming from the clients to this node can be redirected to correct node. Signed-off-by: Sergey Kolosov <[email protected]>
Currently, ValKey doesn't allow to detach replica attached to primary node. So, if you want to change cluster topology the only way to do it is to reset (
CLUSTER RESETcommand) the node. However, this results into removing node from the cluster what affects clients. All clients will keep sending traffic to this node (with getting inaccurate responses) until they refresh their topology.In this change we implement supporting of new argument for CLUSTER REPLICATE command:
CLUSTER REPLICATE NO ONE. When calling this command the node will be converted from replica to empty primary node but still staying in the cluster. Thus, all traffic coming from the clients to this node can be redirected to correct node.