basho/riak_kv — pull request #1027 by russelldb (2014-09-25 15:46:57+00:00)
Title: Attempt to make vnodeids on the same node unique

When a node starts, it starts all its vnodes. Vnode IDs were
generated by each vnode using the nodeid + the current second.
This can lead to multiple vnodes with the same "unique" id.
In the case of imperfect preflists (think a single node "cluster"
as the extreme) multiple actors on a key can have the same id.
This breaks one of the fundamental invariants of version vectors: that
each actor is globally unique. In the worst cases this can lead to
silent dataloss.

This fix, though not perfect, attempts to lessen the likely hood of
vnodes claiming the same id. We use microseconds instead of seconds,
we use the monotonic `erlang:now/0` instead of `os:timestamp/0`. This pushes
the window of probablity from "vnode-starts-in-the-same-second" to
"vnode-starts-11.5-days-later-at-the-same-microsecond".

We have further work planned, but believe this is good enough for now.

Update tests for new id scheme