Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichael-grunder <michael.grunder@gmail.com>2014-07-17 21:41:21 +0400
committermichael-grunder <michael.grunder@gmail.com>2015-05-06 01:05:29 +0300
commitc88cb399cee90b2291b288e8fa51bd9f7af190b3 (patch)
treee83164152cceed780b7ecede73aa88e92bb6ccb7 /cluster_library.c
parenta65301bc2e9b678896675584e3a8e3219aa221f7 (diff)
Skip the failed node when falling back
Diffstat (limited to 'cluster_library.c')
-rw-r--r--cluster_library.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cluster_library.c b/cluster_library.c
index 155f026b..0d202dc8 100644
--- a/cluster_library.c
+++ b/cluster_library.c
@@ -1035,8 +1035,12 @@ static int cluster_sock_write(redisCluster *c, unsigned short slot,
zend_hash_has_more_elements(c->nodes)==SUCCESS;
zend_hash_move_forward(c->nodes))
{
+ /* Grab node */
zend_hash_get_current_data(c->nodes, (void**)&seed_node);
+ /* Skip this node if it's the one that failed */
+ if((*seed_node)->sock == redis_sock) continue;
+
// TODO: Allow for failure/redirection queries to be sent
// to slave nodes, but for now, stick with masters.
if((*seed_node)->slave) continue;