openresty / lua-resty-balancer

A generic consistent hash implementation for OpenResty/Lua
322 stars 77 forks source link

bugfix: fix a typo in chash.reinit #25

Closed ArchangelSDY closed 5 years ago

ArchangelSDY commented 5 years ago

newnodes should be assigned to self.nodes rather than self.newnodes.

agentzh commented 5 years ago

@doujiang24 Will you have a look at this? Thanks.

ArchangelSDY commented 5 years ago

@doujiang24 Sure, updated.

doujiang24 commented 5 years ago

@ArchangelSDY Thanks a lot :)

ArchangelSDY commented 5 years ago

@doujiang24 Could you merge this PR and tag a new release so that we can pick this change in downstream projects?

doujiang24 commented 5 years ago

@ArchangelSDY merged & added a new release tag: v0.02rc5, thanks for your PR :)

ElvinEfendi commented 5 years ago

What's the impact of this bug? As long as a user you aren't relying on nodes to be in sync (covered at https://github.com/openresty/lua-resty-balancer/pull/25/files#diff-cad7d8fbdf9d2fb89f5ee95f0b73dff7R338), there should not be any issue, right?

ArchangelSDY commented 5 years ago

That's right as long as you don't need to read self.nodes. I've added a comment in https://github.com/kubernetes/ingress-nginx/pull/3809#issuecomment-467036731 .