cloudant/mem3 — pull request #14 by davisp (2011-12-20 22:59:50+00:00)
Title: Sync _security objects across the cluster

This works for a very specific situation when shards end up dropping their security object (generally after shard migration). This function will look for the case where a majority of the shards have a non-empty object with a single minority of empty objects. If found, this will rewrite the security object so it's the same throughout the cluster.

If there's any other difference in security objects (three or more versions, or a majority are empty) then a log message is generated for human intervention. This command must be interactively triggered because it'll end up opening every shard in the cluster which is not good on the LRU in couch_server.erl.