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

feat: allow cluster READONLY command #4727

Merged
merged 2 commits into from
Mar 9, 2025
Merged

feat: allow cluster READONLY command #4727

merged 2 commits into from
Mar 9, 2025

Conversation

BorysTheDev
Copy link
Contributor

fixes: #4718

@BorysTheDev BorysTheDev requested a review from romange March 7, 2025 09:23

Verified

This commit was signed with the committer’s verified signature.
tshemsedinov Timur Shemsedinov
@BorysTheDev BorysTheDev force-pushed the allowClusterREADONLYcmd branch from e2cf47e to 1aa3009 Compare March 7, 2025 09:24
assert await m1_node.client.execute_command("GET X") == "1"

# This behavior can be changed in the future
assert await m1_node.client.execute_command("GET Y") == None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, just do not forget to actually call r1_node :)

# create cluster master and replica
# For now replica always should work in read-only mode
# READONLY command returns always OK without any impact
# In the future we may decide to implement the same behavior as REDIS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please open an issue to actually implement this behavior. it can be minor for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified

This commit was signed with the committer’s verified signature.
tshemsedinov Timur Shemsedinov
@BorysTheDev BorysTheDev requested a review from romange March 7, 2025 14:08
@romange romange merged commit 57aa91f into main Mar 9, 2025
10 checks passed
@romange romange deleted the allowClusterREADONLYcmd branch March 9, 2025 07:27
romange pushed a commit that referenced this pull request Mar 9, 2025

Verified

This commit was signed with the committer’s verified signature.
tshemsedinov Timur Shemsedinov
* feat: allow cluster READONLY command
@@ -447,9 +447,6 @@ void ClusterFamily::Cluster(CmdArgList args, const CommandContext& cmd_cntx) {
}

void ClusterFamily::ReadOnly(CmdArgList args, const CommandContext& cmd_cntx) {
if (!IsClusterEmulated()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use IsClusterEnabledOrEmulated here and in ClusterFamily::ReadWrite

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 is incorrect in cluster mode
3 participants