edwingeng / doublejump Goto Github PK
View Code? Open in Web Editor NEWA revamped Google's jump consistent hash
License: BSD 3-Clause "New" or "Revised" License
A revamped Google's jump consistent hash
License: BSD 3-Clause "New" or "Revised" License
场景:
假设有A,B,C,D,E五个节点提供服务,某时刻Remove了节点C,此时数据被hash到A,B,D,E四个节点,假设之后又过了一段时间,B发生了重启(无论B是从类似etcd中获得节点列表,还是通过其他方法发现其他存活的节点),那此时B节点对数据的hash是和其他节点完全不一致的。
假设再Remove节点C后,对A,B,D,E均调用Shrink,则Shrink之后各节点对数据的hash,和节点移除前基本是完全不一样的(测试和推理均可说明),这也是不合适的(违背了迁移数据最少的初衷)
感觉上面场景的问题,解决办法应该是,在B重启后,仍然获取A,B,C,D,E节点,然后调用Remove C节点。但这个在集群比较大时,就比较混乱了。
感觉这个实现应该是节点替换的场景比较适用,比如B节点挂了,立即添加F节点替换B。
====上面的推测分析是否正确,如何解决比较合适?
instead of single-character names such as n, a, f, m, etc. it would be more useful to see names that mean something.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.