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

Does the client work for Elasticache cluster mode enabled #20

Open
abinavv20 opened this issue Mar 8, 2022 · 4 comments
Open

Does the client work for Elasticache cluster mode enabled #20

abinavv20 opened this issue Mar 8, 2022 · 4 comments

Comments

@abinavv20
Copy link

The client doesn't look like maintains the slot to node mapping. Does this mean that this client can't be used with Elasticache cluster mode enabled?

@funny-falcon
Copy link
Contributor

Why do you think it doesn't maintain slot to node mapping?
rediscluster folder is explicitly for that.

@abinavv20
Copy link
Author

abinavv20 commented Mar 9, 2022

Our redis metrics indicate that only the primary is accepting writes and replica is accepting reads. The primary usually accepts writes and reads. Does it have to do with this line of code here? https://github.com/joomcode/redispipe/blob/master/rediscluster%2Fcluster.go#L436-L441

image

@funny-falcon
Copy link
Contributor

You can set policy with Cluster.WithPolicy:

func (c *Cluster) WithPolicy(policy ReplicaPolicyEnum) PolicyMan {

I don't get which way read commands go to replica if you didn't specify policy, since you correctly mention MasterOnly is primary policy.

@abinavv20
Copy link
Author

abinavv20 commented Mar 10, 2022

I will try this out.

I believe the default behavior should be primary accepting writes and reads and replica is accepting only reads, even without specifying policy. This is the behavior of redis cluster mode.

Can I bring this up as an issue for bug fix?

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

No branches or pull requests

2 participants