improved read quorum and repair for open_revs
improved read quorum and repair for open_revs

There are important distinctions between requests with open_revs=all,
requests with an explicit revision list and latest=true, and a simple
revision list.  When open_revs=all, we take the union of all revisions
returned by the workers, then reduce it by filtering out ancestors on
each edit branch.  An ancestor counts towards the descendant's read
quorum.

If an explicit revision list is given, a worker can respond with
{{not_found, missing}, Rev}, an {ok, #doc{}} corresponding to the rev
in question, or an {ok, #doc{}} with a newer revision if latest=true
is supplied.  not_found is considered to be an ancestor of any {ok,_}
revision for quorum purposes.

Down workers do not contribute to the read quorum.

If workers disagree at all on the response, read repair will run
asynchronously.  The repair tries to save all the latest #doc{} records
(i.e. the ones w/o descendants) which were received during the voting.

BugzID 11047

georgemarshall/bigcouch,georgemarshall/bigcouch,georgemarshall/bigcouch,benoitc/bigcouch,PerilousApricot/bigcouch,kofron/bigcouch,kofron/bigcouch,breezjw/bigcouch,bittorrent/bigcouch,andrejb/cloudant_bigcouch,linearregression/bigcouch,georgemarshall/bigcouch,benoitc/bigcouch,breezjw/bigcouch,andrejb/cloudant_bigcouch,cloudant/bigcouch,georgemarshall/bigcouch,linearregression/bigcouch,linearregression/bigcouch,kofron/bigcouch,linearregression/bigcouch,benoitc/bigcouch,Asquera/bigcouch,bittorrent/bigcouch,kofron/bigcouch,Gussy/bigcouch,breezjw/bigcouch,Gussy/bigcouch,andrejb/cloudant_bigcouch,PerilousApricot/bigcouch,andrejb/cloudant_bigcouch,benoitc/bigcouch,kofron/bigcouch,davidcoallier/bigcouch,Gussy/bigcouch,georgemarshall/bigcouch,davidcoallier/bigcouch,andrejb/cloudant_bigcouch,bittorrent/bigcouch,linearregression/bigcouch,bittorrent/bigcouch,Asquera/bigcouch,cloudant/bigcouch,davidcoallier/bigcouch,Gussy/bigcouch,breezjw/bigcouch,andrejb/cloudant_bigcouch,Asquera/bigcouch,cloudant/bigcouch,Asquera/bigcouch,kofron/bigcouch,Asquera/bigcouch,cloudant/bigcouch,Gussy/bigcouch,bittorrent/bigcouch,davidcoallier/bigcouch,Gussy/bigcouch,cloudant/bigcouch,davidcoallier/bigcouch,linearregression/bigcouch,davidcoallier/bigcouch,PerilousApricot/bigcouch,linearregression/bigcouch,bittorrent/bigcouch,cloudant/bigcouch,cloudant/bigcouch,breezjw/bigcouch,breezjw/bigcouch,PerilousApricot/bigcouch,Asquera/bigcouch,benoitc/bigcouch,andrejb/cloudant_bigcouch,PerilousApricot/bigcouch,PerilousApricot/bigcouch,benoitc/bigcouch