Skip to content
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

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

soloestoy
Copy link
Member

fixes #1348

Copy link

codecov bot commented Nov 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.77%. Comparing base (653d5f7) to head (c87b50f).

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     
Files with missing lines Coverage Δ
src/cluster.c 88.57% <100.00%> (+0.06%) ⬆️

... and 15 files with indirect coverage changes

---- 🚨 Try these New Features:

@zuiderkwast
Copy link
Contributor

I'm not sure we should fix this. See the discussion in #1348.

Copy link
Contributor

@zuiderkwast zuiderkwast left a 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.

Comment on lines +1475 to +1477
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.");
Copy link
Contributor

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).

Suggested change
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");

@soloestoy
Copy link
Member Author

especially for compatibility with other databases (kvrocks, keydb, who knows).

I think the order is reversed, they should be compatible with us, not the other way around, haha.

@zuiderkwast
Copy link
Contributor

especially for compatibility with other databases (kvrocks, keydb, who knows).

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

READONLY not returning an error in standalone mode broke some test case for Valkey-py.
2 participants