-
Notifications
You must be signed in to change notification settings - Fork 167
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
Random NoQuorum Errors when using a redis cluster with multiple nodes. #91
Comments
Additional info:
Lock creation:
|
Are you two servers a master/replica configuration, a Redis Cluster (with keys sharded across both), or two independent servers? And in your RedLockFactory configuration, are you only connecting to one of them? |
Redis Cluster. We're using terraform and it's all created in one |
So I tried bosting the number of lock requests in my tests from 500 to 700 and now I get the NoQuorum errors from the single node redis instance as well so my it isn't a number of nodes issue. |
After some more experimentation I realized if I increase the wait time for the lock creation the errors disappear. Is it possible for NoQuorum statuses to be returned for timeouts? |
Yes, that is possible. If an attempt to acquire a lock in an instance doesn't complete within the timeout it is treated as a failure, and if there aren't enough successfully acquired instances to meet the quorum then it will fail with The quorum required is
|
Does Redlock do some kind of introspection when it is passed the endpoint? This is being used with an AWS elasticache "cluster mode enabled" cluster - it has 3 shards and 6 nodes. AWS docs state that you should just do all your writes through their "connection endpoint"
Does Redlock (or the underlying stackexchange redis driver) somehow look up the cluster information from that single endpoint, or do we need to configure things differently in order to use a cluster like this in AWS. Somehow it must know that it doesn't just have a single instance (otherwise why would it throw errors about It seems that the recommended way to do it would be to use multiple (3) standalone redis nodes and pass each of them in as endpoints to the redlock and then redlock will maintain a quorum with those standalone nodes on its own? |
I haven't used Redis on AWS myself, so I'm not too sure whether they do things any differently to a standard Redis Cluster.
RedLock.net doesn't do anything specific to look up cluster information - if anything happens there it would be within StackExchange.Redis. If you are only providing one It is possible to get
Yes, that would be the suggested way to do it if you want more resilience than is offered by a single standalone instance. |
What's the difference between retries configured by |
We have a cluster with 2 nodes and have been regularly getting random NoQuorum errors when creating many locks to it.
I've experimented by making creating 500 locks to it and usually get from 1-20 NoQuorum errors. When doing the same with a single node redis instance I don't get the errors. The readme states
Using replicated instances is not the suggested way to use RedLock
but also says it supports it so I'm not sure if these errors are expected or not. Currently using RedLock.net 2.3.1.The text was updated successfully, but these errors were encountered: