Hi, 我觉得这并不是一个 bug,ConsistentHashLoadBalance 只根据运行时参数值进行负载均衡。 如果两个接口的参数值相同,那么这两个远程调用会被分配到同一台机器上。当接口方法中 不存在参数时,我们也可认为他们的参数值是相同的,从源码的角度来说,它们都是空串。 因此在运行时,ConsistentHashLoadBalance 会将不存在参数的远程调用分配到同一个机器上。
translate by Google Translator: I don't think this is a bug. ConsistentHashLoadBalance only load balances based on runtime parameter values. If the parameter values of the two interfaces are the same, then the two remote calls are assigned to the same machine. In the interface method When there are no parameters, we can also think that their parameter values are the same. From the source point of view, they are all empty strings. So at runtime, ConsistentHashLoadBalance will assign remote calls with no parameters to the same machine. > 在 2019年2月13日,下午8:20,Xianjun Ke <[email protected]> 写道: > > Good question. And about your last question, I have made some test in my > local machine, > it seems that there is a bug about the ConsistentHashLoadBalance when the > method has > no argument, pls refer this issue [1] > > [1] https://github.com/apache/incubator-dubbo/issues/3468 > > 一直以来 <[email protected]> 于2019年2月13日周三 下午3:41写道: > >> ConsistentHash LoadBalance:一致性 >> Hash,相同参数的请求总是发到同一提供者。当某一台提供者挂时,原本发往该提供者的请求,基于虚拟节点,会平摊到其它提供者,不会引起剧烈变动。缺省只对第一个参数进行Hash运算。 >> >> 第一个参数指什么??是每个接口中方法的第一个参数吗,如果是的话,如果方法没有参数是什么行为?请教,感谢!
