memcached icon indicating copy to clipboard operation
memcached copied to clipboard

option failOverServers ignorred

Open mlazarov opened this issue 11 years ago • 3 comments

I'm trying to do failover with memcachedb (one server is master and one is slave).

server_1 is administratively down

When trying this:

var memcached = new Memcached('server_1:11212', {retries:10,retry:10000,remove:true,failOverServers:['server_2:11212']});

memcached never tries to connect to server_2 even if server_1 is down

What's wrong?

mlazarov avatar Mar 26 '13 15:03 mlazarov

Hi there!

I'm having the same issue and this looks like an important feature to have... I don't mind forking and fixing it myself, but some directions would be much appreciated :)

acarrasco avatar Oct 07 '14 14:10 acarrasco

I'm also experiencing this same issue.

flsafe avatar Oct 07 '14 14:10 flsafe

Is this issue resolved yet for single master / slave server? It works fine if we have more than 1 master node but not working for 1 master node. Replacing the server upon failure just replaces the servers in hashring and not in memcached (this.servers), so the below logic seems to be wrong.

// try to find the correct server for this query if (!server) { // no need to do a hashring lookup if we only have one server assigned to // us if (this.servers.length === 1) { server = this.servers[0]; // -> this seems to be wrong since the this.servers is not getting updated upon servers swap } else { if (redundancy && queryRedundancy) { redundancy = this.HashRing.createRange(query.key, (this.redundancy + 1), true); server = redundancy.shift(); } else { server = this.HashRing.get(query.key); } } }

ChinmoyMahapatra avatar Sep 24 '21 10:09 ChinmoyMahapatra