You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.
Replica points are added by concatenation onto the server name, which is currently of the form a.b.c.d:X. If you have a=1.2.3.4:55 and b=1.2.3.4:555, you will have some overlap, e.g. with replica points 5 and 55, respectively, where a + '55' === b + '5', and therefore hash identically.
This is probably an atypical configuration, and probably not a major concern, but as we consider a future with logical IDs, this could become a bigger of a potential question mark.
Probably the simplest thing is simply to insert '/' or '#' in between. In any consistent naming scheme, this would make all points unique.
Some trivial code to demonstrate this is below -- no matter how much you adjust the offset, 's1:11' is always underrepresented.
test('random hosts with good points show good distribution',functiont(assert){varring=newHashRing({replicaPoints: 100});varservers=['s1:1','s1:11','s2:2','s2:5'];varcounts={};for(vari=0;i<servers.length;i++){varserver=servers[i];ring.addServer(server);counts[server]=0;}varoffset=20*1000000;for(vari=0;i<1000000;i++){s=ring.lookup((i+offset)+'');counts[s]++}console.log(counts);assert.end();});
The text was updated successfully, but these errors were encountered:
@CorgiMan Recently found the same. Although the fix is simple it is hard to deploy to running systems without a lot of forwarding inconsistencies. The moment you start upgrading your system after such a fix there will be disagreement on key ownership till the upgrade has completely completed.
Since the chances of such port configurations are slim in our current situation it might break more than it solves.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Replica points are added by concatenation onto the server name, which is currently of the form
a.b.c.d:X
. If you havea=1.2.3.4:55
andb=1.2.3.4:555
, you will have some overlap, e.g. with replica points 5 and 55, respectively, wherea + '55' === b + '5'
, and therefore hash identically.This is probably an atypical configuration, and probably not a major concern, but as we consider a future with logical IDs, this could become a bigger of a potential question mark.
Probably the simplest thing is simply to insert '/' or '#' in between. In any consistent naming scheme, this would make all points unique.
Some trivial code to demonstrate this is below -- no matter how much you adjust the offset, 's1:11' is always underrepresented.
The text was updated successfully, but these errors were encountered: