uber-node / ringpop-node

Scalable, fault-tolerant application-layer sharding for Node.js applications
http://uber.github.io/ringpop/
MIT License
1.18k stars 146 forks source link

Status refactor 1: Refactor membership to use localMember as the source of truth #291

Closed mennopruijssers closed 8 years ago

mennopruijssers commented 8 years ago

Use a in-memory object to represent once local state. This makes the code path that updates the local state more robust. Instead of changing the state of the current node by updating it using updates, we just change the localMember. Whenever a gossip comes in changing the current state, we can always "counter-gossip" with the current state.

Note: this is the first PR of a serie of refactors:

thanodnl commented 8 years ago

LGTM

motiejus commented 8 years ago

Besides the incarnation number change (non-blocking, just let me know what you think), LGTM.

mennopruijssers commented 8 years ago

As discussed offline with @thanodnl I renamed shouldProcessChange to shouldProcessGossip. He's doing the same in ringpop-go so we have them in sync. (Because I already merged in the other PR's it's easier to just check: https://github.com/uber/ringpop-node/pull/291/commits/17ae4060b67d124812ac98e7aae9b281a88b86c6)