-
Notifications
You must be signed in to change notification settings - Fork 677
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
allow READONLY&READWRITE only after CLIENT CAPA REDIRECT for standalone mode #1351
base: unstable
Are you sure you want to change the base?
Conversation
…ne mode Signed-off-by: zhaozhao.zz <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## unstable #1351 +/- ##
============================================
+ Coverage 70.63% 70.77% +0.14%
============================================
Files 116 116
Lines 63303 63307 +4
============================================
+ Hits 44711 44803 +92
+ Misses 18592 18504 -88
|
I'm not sure we should fix this. See the discussion in #1348. |
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'm convinced we should do this fix, especially for compatibility with other databases (kvrocks, keydb, who knows). Many clients support not only Valkey.
Only one comment is about the error message.
addReplyError(c, "This instance has cluster support disabled," | ||
" you need to execute the CLIENT CAPA REDIRECT command," | ||
" before you can use the READONLY command in standalone mode."); |
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.
These very long error messages that include the full documentation are not my favourite style.
If you (a user) get an error, you would normally go to the documentation for the READONLY command and find out what it means.
A more concise way is to say that READONLY is allowed only if redirects are enabled. This includes cluster (always) and standalone (with client capa redirect).
addReplyError(c, "This instance has cluster support disabled," | |
" you need to execute the CLIENT CAPA REDIRECT command," | |
" before you can use the READONLY command in standalone mode."); | |
addReplyError(c, "Redirects are not enabled"); |
I think the order is reversed, they should be compatible with us, not the other way around, haha. |
Yes, we can think that we are the best and greatest, but this is like Redis style thinking. I don't want to think in this way. |
fixes #1348