-
Notifications
You must be signed in to change notification settings - Fork 685
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
replica redirect read&write to primary in standalone mode #325
Conversation
Signed-off-by: zhaozhao.zz <zhaozhao.zz@alibaba-inc.com>
106cac7
to
8fce41e
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.
High level LGTM.
(I didn't review the documentation of the config yet.)
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.
generally LGTM. I think the slot number -1 is acceptable, and i suppose that many clients will find that it is easy to add the support. (but we seem to be lacking the most support from clients right now.)
The other one is announced-ip and announced-port, i'm not sure about this.
Signed-off-by: zhaozhao.zz <zhaozhao.zz@alibaba-inc.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #325 +/- ##
============================================
- Coverage 70.17% 69.99% -0.19%
============================================
Files 110 110
Lines 60077 60108 +31
============================================
- Hits 42160 42070 -90
- Misses 17917 18038 +121
|
@soloestoy Now it looks like we agree to add "-REDIRECT ip port", I think you could update the top description to match the latest decision. Thanks |
Highlighting my two concerns:
|
After the discussion I think we have an agreement about the redirections value, and need a bit change that this feature should not be a config in server. To make it as a flag of per client would be better ( |
|
Summarizing @valkey-io/core-team's discussion and thought process:
|
Even if we allow the client to opt-in via a new command like |
Can you elaborate more, because I don't think there are that many real cases like this. |
Signed-off-by: zhaozhao.zz <zhaozhao.zz@alibaba-inc.com>
0c67122
to
be838bc
Compare
I removed the server config, and make it as a per client opt-in feature via |
Signed-off-by: zhaozhao.zz <zhaozhao.zz@alibaba-inc.com>
Signed-off-by: zhaozhao.zz <zhaozhao.zz@alibaba-inc.com>
Signed-off-by: zhaozhao.zz <zhaozhao.zz@alibaba-inc.com>
it's ready to be merged, @valkey-io/core-team please approve |
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 good in general. Some comments about CLIENT CAPA.
Signed-off-by: zhaozhao.zz <zhaozhao.zz@alibaba-inc.com>
…memory Signed-off-by: zhaozhao.zz <zhaozhao.zz@alibaba-inc.com>
Signed-off-by: zhaozhao.zz <zhaozhao.zz@alibaba-inc.com>
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.
i guess we also need to update the doc (READONLY) and add a new command doc
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.
Other reviewers: Please take a look at the new subcommand CLIENT CAPA capa [capa...]
, returns OK, ignores unknown capabilities from the future. (They can be sent by future clients supporting future Valkey versions.)
We need docs for -REDIECT and for CLIENT CAPA.
Signed-off-by: zhaozhao.zz <zhaozhao.zz@alibaba-inc.com>
…151) to valkey-io/valkey#325 --------- Signed-off-by: zhaozhao.zz <zhaozhao.zz@alibaba-inc.com> Co-authored-by: Viktor Söderqvist <viktor.soderqvist@est.tech>
In case of an instance role switch in standalone mode, clients with blocking commands get disconnected sending an UNBLOCKED error to the client. Now that the REDIRECT error is available as an alternative (valkey-io#325), issue a REDIRECT (redirecting the client to the primary) for clients that are supporting it. There is no need to disconnect the client in this case. This is in-line with the semantics of the MOVED error in cluster mode. Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
In case of an instance role switch in standalone mode, clients with blocking commands get disconnected sending an UNBLOCKED error to the client. Now that the REDIRECT error is available as an alternative (valkey-io#325), issue a REDIRECT (redirecting the client to the primary) for clients that are supporting it. There is no need to disconnect the client in this case. This is in-line with the semantics of the MOVED error in cluster mode. Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
In case of an instance role switch in standalone mode, clients with blocking commands get disconnected sending an UNBLOCKED error to the client. Now that the REDIRECT error is available as an alternative (valkey-io#325), issue a REDIRECT (redirecting the client to the primary) for clients that are supporting it. If a client is read-only, it may remain blocked in some situations. There is no need to disconnect the client in either case. This is in-line with the semantics of the MOVED error in cluster mode. Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
In case of an instance role switch in standalone mode, clients with blocking commands get disconnected sending an UNBLOCKED error to the client. Now that the REDIRECT error is available as an alternative (valkey-io#325), issue a REDIRECT (redirecting the client to the primary) for clients that are supporting it. If a client is read-only, it may remain blocked in some situations. There is no need to disconnect the client in either case. This is in-line with the semantics of the MOVED error in cluster mode. Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
In case of an instance role switch in standalone mode, clients with blocking commands get disconnected sending an UNBLOCKED error to the client. Now that the REDIRECT error is available as an alternative (valkey-io#325), issue a REDIRECT (redirecting the client to the primary) for clients that are supporting it. If a client is read-only, it may remain blocked in some situations. There is no need to disconnect the client in either case. This is in-line with the semantics of the MOVED error in cluster mode. Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
READONLY not returning an error in standalone mode broke some test case for Valkey-py. Reported by @mkmkme:
I guess we should have added a check for CLIENT CAPA REDIRECT in the READONLY and READWRITE commands, to keep the old behaviour for old clients. |
Behaviour of READONLY was changed in valkey-io/valkey#325 which became a part of 8.0.0. This caused test_readonly_invalid_cluster_state to fail. This commit takes into account this change. Signed-off-by: Mikhail Koviazin <mikhail.koviazin@aiven.io>
Behaviour of READONLY was changed in valkey-io/valkey#325 which became a part of 8.0.0. This caused test_readonly_invalid_cluster_state to fail. This commit takes into account this change. Signed-off-by: Mikhail Koviazin <mikhail.koviazin@aiven.io>
To implement #319
CLIENT CAPA redirect
, a client can announce the capability to handle redirectionreadonly
andreadwrite
command in standalone mode, may be a breaking change