coreos/etcd — pull request #190 by ebroder (2013-09-27 00:22:39+00:00)
Title: Add support for sequentially-named keys

By passing sequential=true to a set call, etcd appends a monotonically
increasing (0-padded) number to the key name before actually storing
it. Sequentially-named keys are useful for patterns like leader
election or mutexes where it's necessary to have an externally visible
ordering of requests.

This turned out to be pretty straightforward, as etcd already
maintains something we can use as a monotonically increasing number -
namely the current index of the raft machine, so we just append that
to the key name.