Skip to content

Instantly share code, notes, and snippets.

@PharkMillups
Created May 14, 2010 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PharkMillups/401507 to your computer and use it in GitHub Desktop.
Save PharkMillups/401507 to your computer and use it in GitHub Desktop.
tilgovi # justinsheehy: re your recent email. are you guarenteed each node will have 1 or 2 copies (n=3) in a 2-node cluster or is it just probable? in other words, I thought the replication scheme was deterministic and vnode based. there's no guarantee the ownership of those vnodes doesn't fall entirely on one node, no?
seancribbs # tilgovi: where data is replicated to is determined by the vnode/partition. so the key is hashed to a single partition, then subsequent partitions are selected for the other copies. It just happens that adjacent partitions are not usually on the same node. the claim function tries to minimize overlap
you can be fairly certain that one node will get two copies, and the other will get 1 copy.
tilgovi # seancribbs: thanks for the explanation
so, it's the algorithm by which nodes claim vnodes that prevents contiguous vnodes from being hosted in the same place
if I understand correctly
seancribbs # yes the claim function tries to give each node an equal number of partitions and also to round-robin the distribution of them. on some rare occasions when adding or removing a node, things will be reshuffled to be more balanced.
tilgovi # excellent. thanks again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment