antirez/redis — pull request #1594 by mattsta (2014-03-11 18:23:05+00:00)
Title: Add cluster-config-file locking

This is a first attempt at fixing the ongoing problem of people
launching multiple Redis Cluster instances in the same directory
with default options (which makes all instances use the same
"nodes.conf" which breaks their cluster).

This commit uses a `flock` approach to the problem. Another
valid solution would be to use an external lock file. Another
valid pattern would be to obtain the lock in `clusterInit`
instead of where we read/create the config in `clusterLoadConfig`.

Do we allow runtime moving of cluster-config-file? If so,
this commit doesn't handle that case yet. Actually, I just
checked, and the 'set' command doesn't work at all in
a cluster because:
```haskell
127.0.0.1:37446> set cluster-config-file poo.conf
(error) MOVED 13508 127.0.0.1:19029
127.0.0.1:37446> debug cmdkeys set cluster-config-file poo.conf
1) "cluster-config-file"
```