框架的一致性哈希重构
当前的一致性哈希存在四个bug,分别进行分析
以这个版本https://git.huya.com/server_arch/taf/-/blob/924950284557f183bd025ed758dc2e878ae36938/src/libservant/EndpointManager.cpp#L2448为例
我新增了部分日志,总体流程的关键代码在getConHashProxyForNormal
他的输入是hashCode(也就是prx->taf_consistent_hash(hashCode)
传入的),输出是本次负载均衡选出的节点指针
1 | AdapterProxyPtr EndpointManager::getConHashProxyForNormal(int64_t hashCode) |