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
How to avoid CLUSTERDOWN and UNBLOCKED? #28
Comments
It seems that we can just resend the command when a CLUSTERDOWN error is received. Thank you for the information. If you want to handle CLUSTERDOWN on the application side, you have to catch all errors returned from Redis and resend the command if the error is CLUSTERDOWN. |
I'm also getting a lot of these:
|
You can get previous errors by redis.multi().set('foo').get('foo').exec().catch(function (err) {
console.log(err.previousErrors);
}); |
And by the way, if the library has the autoResendUnfulfilledCommands option enabled by default, shouldn't it resend automatically after recovering from CLUSTERDOWN? |
|
Now I have 3 masters and 9 slaves, let's keep this open for some days so I can see if those errors persist. I've also configured the cluster with "cluster-slave-validity-factor 0" and "cluster-migration-barrier 1" |
good reference: http://redis.io/presentation/Redis_Cluster.pdf |
even after increasing slaves and changing config to be more available, I'm receiving EXECABORT ocasionally with this previousErrors:
|
@thelinuxlich I believe you are trying to perform multi-key operations on the cluster, therefore you get the following errors If you need to that, you need to make sure they have the same hash, ie |
You mean, using multi(), right? |
My code has one transaction:
|
Is there a resharding or failover happens after cluster has been initialized? |
no, probably the multi() is not going to the right node |
In that case multi() is fine (same key -> @luin, please take a look at this, as I believe it needs to be improved. IE,
|
By the way, I didn't have this problem with a similar library: https://github.com/thunks/thunk-redis Their API forces you to set the key explicitly on the multi() and exec() methods |
Yes, you are right. ioredis should be able to handle these |
@thelinuxlich thunk-redis takes hash from the first key, and then applies it to all the operations in the multi, but they don't make use of pipeline. Here the first key from pipeline is taken and then the hash is applied to the whole pipeline. Beside that its pretty much the same, except that ioredis seems cleaner (and with a bug not handling |
@thelinuxlich As stated in the README, ioredis will use the first key in the pipeline queue to calculate the slot. So the problem here isn't ioredis use the wrong key, instead is ioredis doesn't handle |
ok, maybe refreshAfterFails = 1 can solve the issue? |
@thelinuxlich No, it doesn't help since it's a bug of ioredis. I'll fix it soon :-) |
Dont know if it is luck, but since setting refreshAfterFails to 1 no error happened |
@thelinuxlich That's interesting. However I'm implementing a more stable transaction strategy in cluster mode. |
let's test it ;) |
still getting MOVED errors :( |
@thelinuxlich Yes, this commit just fixed CLUSTERDOWN errors, and I'm still working on handling MOVED errors :-) |
There is lot of work to do to implement a stable transaction in cluster mode. However the job is getting done :-) |
Great, every new release I'm always testing :) |
Released in 1.3.0 |
No errors so far... |
Seems fixed! |
Revisiting this problem, I asked on the redis google group about it and here it is what @antirez said:
Configuration-wise, I've set my cluster with "cluster-require-full-coverage" to "no" so I just need to know how to cover this on the application side
The text was updated successfully, but these errors were encountered: