qiandu2006
qiandu2006
在采用一致性哈希这种方式进行路由选择,对业务方的接口承诺保持一致应该比较好吧? 即,因扩缩容导致节点新增或减少,应该还是按照一致性哈希的方式进行rehash来选择路由。
另外,一致性哈希映射的过程,是从键空间->虚拟节点空间->物理节点空间。通过均衡虚拟节点空间->物理节点空间的映射,要求在物理节点挂掉时,虚拟节点空间到物理节点空间的映射变化时均匀的,即挂掉的物理节点上承担的虚拟空间分布均分到其他物理节点上,按取模方式并不能保证这一点吧?
> I think that the implementation is racy, especially the Add/Done side. > According to this link https://www.modernescpp.com/index.php/c-core-guidelines-be-aware-of-the-traps-of-condition-variables atomic variable modification should be made under the lock Agreed on this....