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

Add support of the command READONLY & READWRITE #2166

Closed
1 of 2 tasks
Tracked by #1942
singular-seal opened this issue Mar 14, 2024 · 4 comments · Fixed by #2173
Closed
1 of 2 tasks
Tracked by #1942

Add support of the command READONLY & READWRITE #2166

singular-seal opened this issue Mar 14, 2024 · 4 comments · Fixed by #2173
Assignees
Labels
enhancement type enhancement good first issue Good for newcomers help wanted Good for newcomers

Comments

@singular-seal
Copy link

Search before asking

  • I had searched in the issues and found no similar issues.

Motivation

  1. redis cluster utilize readonly to support reading from slave node
  2. go-redis will send a 'readonly' command to server when 'ReadOnly' option is true during initialisation which would incur an error response from kvrocks 'ERR unknown command readonly' because kvrocks doesn't support command 'readonly'
  3. this is important because without reading from slave a shard is not readable during failover which is not acceptable for some businesses

Solution

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@singular-seal singular-seal added the enhancement type enhancement label Mar 14, 2024
@git-hulk git-hulk added help wanted Good for newcomers good first issue Good for newcomers labels Mar 14, 2024
@git-hulk
Copy link
Member

@singular-seal Thanks for your feedback.

@git-hulk git-hulk changed the title need support for readonly command Add support of the command READONLY Mar 14, 2024
@git-hulk git-hulk changed the title Add support of the command READONLY Add support of the command READONLY & READWRITE Mar 14, 2024
@LiuYuHui
Copy link
Contributor

Hi @git-hulk, I want to help implement this feature, could you give me some suggestions on where to start? thanks a lot!

@git-hulk
Copy link
Member

@LiuYuHui Thank you! Go ahead.

@jihuayu
Copy link
Member

jihuayu commented Mar 15, 2024

Hi @LiuYuHui.
You can add a flag in redis::Connection to store if this connection enables read queries.
You can add new commands in cmd_server.cc

The following code may be the code you need to modify.

If you have any other questions, feel free to ask me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement type enhancement good first issue Good for newcomers help wanted Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants