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

Failover Servers not working when only 1 master server #364

Open
ChinmoyMahapatra opened this issue Sep 24, 2021 · 0 comments
Open

Failover Servers not working when only 1 master server #364

ChinmoyMahapatra opened this issue Sep 24, 2021 · 0 comments

Comments

@ChinmoyMahapatra
Copy link

Failover servers work 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);
}
}
}

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

1 participant