couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [15/50] fabric commit: updated refs/heads/windsor-merge-121 to 79e6e2f
Date Fri, 01 Aug 2014 09:12:03 GMT
Fix changes shard replacement

We were unwittingly falling victim to list comprehensions swallowing
exceptions again. The result this time was that anytime we needed to
replace a changes shard we were adding the entire shard map. This means
that any time we were resetting the feed its possible we could have
reset the feed for all shard ranges depending on the rexi worker race.

BugzId: 22808


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/3804a0a4
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/3804a0a4
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/3804a0a4

Branch: refs/heads/windsor-merge-121
Commit: 3804a0a4a944e12716aeeb5a7a4342b0b61c5050
Parents: f371174
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Fri Sep 6 06:17:44 2013 -0500
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Jul 31 11:12:00 2014 +0100

----------------------------------------------------------------------
 src/fabric_view_changes.erl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/3804a0a4/src/fabric_view_changes.erl
----------------------------------------------------------------------
diff --git a/src/fabric_view_changes.erl b/src/fabric_view_changes.erl
index cff28fd..293541e 100644
--- a/src/fabric_view_changes.erl
+++ b/src/fabric_view_changes.erl
@@ -362,7 +362,8 @@ do_unpack_seqs(Opaque, DbName) ->
         true ->
             Unpacked;
         false ->
-            Ranges = lists:usort([R || #shard{range=R} <- Unpacked]),
+            Extract = fun({Shard, _Seq}) -> Shard#shard.range end,
+            Ranges = lists:usort(lists:map(Extract, Unpacked)),
             Filter = fun(S) -> not lists:member(S#shard.range, Ranges) end,
             Replacements = lists:filter(Filter, mem3:shards(DbName)),
             Unpacked ++ [{R, 0} || R <- Replacements]


Mime
View raw message