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

Interest in supporting AWS Elasticache replication group failover #550

Closed
craigmcnamara opened this issue Sep 23, 2015 · 5 comments
Closed

Comments

@craigmcnamara
Copy link

I made a gem here: https://github.com/craigmcnamara/redis-elasticache

I'd happily make it an optional addon to redis-rb if you'd accept a pull request.

@badboy badboy closed this as completed Mar 29, 2016
@ndbroadbent
Copy link

Hi @craigmcnamara, thanks for working on this! I didn't realize I would need to do something extra to support ElastiCache failover. I have seen some ReadOnly errors in the past that this gem should fix, so I will try it out!

However, now I'm struggling with a different error during failover: #949

Would the redis-elasticache addon also help with this?

Also, does redis-elasticache break a standard Redis installation? (e.g. during tests on CI, or for other deployments that don't use ElastiCache.) Do you think it is safe to always use redis-elasticache, or should I add a way to manually enable it when needed?

Thanks!

@ndbroadbent
Copy link

ndbroadbent commented Sep 30, 2020

Ahh, I can see the code just checks for some error messages and raises a different error to force a reconnect: https://github.com/craigmcnamara/redis-elasticache/blob/master/lib/redis/elasticache/failover.rb

So it looks like this won't help with my current issue, but I'll definitely use this anyway! Thanks!

@uiur
Copy link

uiur commented Oct 4, 2020

I was seeing a similar issue,
but I've found that current elasicache doesn't have this issue by default.

close-on-replica-write is enabled by default, and it disconnects connections with write command to replica automatically.

If enabled, clients who attempt to write to a read-only replica will be disconnected.

https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/ParameterGroups.Redis.html#ParameterGroups.Redis.2-8-23

@timanovsky
Copy link

I was seeing a similar issue,
but I've found that current elasicache doesn't have this issue by default.

close-on-replica-write is enabled by default, and it disconnects connections with write command to replica automatically.

If enabled, clients who attempt to write to a read-only replica will be disconnected.

https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/ParameterGroups.Redis.html#ParameterGroups.Redis.2-8-23

It may still be needed. Looks like LUA invocations are not handled properly and still fail with READONLY error

@jebw
Copy link

jebw commented Apr 24, 2023

For anyone upgrading to Redis 5 gem, looks like this maybe fixed in v5.0.6 now

https://github.com/redis/redis-rb/blob/master/CHANGELOG.md#506

#1168

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

6 participants