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
for (Invoker invoker : invokers) {
for (int i = 0; i < replicaNumber / 4; i++) {
byte[] digest = md5(invoker.getUrl().toFullString() + i);
for (int h = 0; h < 4; h++) {
long m = hash(digest, h);
virtualInvokers.put(m, invoker);
}
}
}
RT, 发现在consistent hash计算virtual invokers时,同样的provider节点,算出来的hash是不同的。
for (Invoker invoker : invokers) {
for (int i = 0; i < replicaNumber / 4; i++) {
byte[] digest = md5(invoker.getUrl().toFullString() + i);
for (int h = 0; h < 4; h++) {
long m = hash(digest, h);
virtualInvokers.put(m, invoker);
}
}
}
同一个provider的 invoker.getUrl().toFullString() 最后的timestamp不相同,两个consumer上的结果如下:
dubbo://172.16.1.40:20880/com.test.demo.DemoService?anyhost=true&application=demo-consumer&check=false&dubbo=2.8.4&generic=false&interface=com.test.demo.DemoService&loadbalance=consistenthash&methods=sayHello&pid=68060&side=consumer×tamp=1502361420315
dubbo://172.16.1.40:20880/com.test.demo.DemoService?anyhost=true&application=demo-consumer&check=false&dubbo=2.8.4&generic=false&interface=com.test.demo.DemoService&loadbalance=consistenthash&methods=sayHello&pid=68468&side=consumer×tamp=1502361415516
导致的结果,多个consumer同时调用,同样的request并不能路由到同一个provider。
The text was updated successfully, but these errors were encountered: