couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [42/49] fabric commit: updated refs/heads/windsor-merge to b1c0030
Date Fri, 01 Aug 2014 14:35:03 GMT
Clear worker references for get_shard_replacements

This function relies on record equality. If a request passes workers
that have references defined it would return all copies of the shard
range incorrectly.

BugzId: 28992


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

Branch: refs/heads/windsor-merge
Commit: 992cf38e20c80a32be7ae219576be121f8dd51be
Parents: 63ec0f9
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Wed Mar 12 02:25:35 2014 -0400
Committer: Robert Newson <rnewson@apache.org>
Committed: Fri Aug 1 15:33:43 2014 +0100

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


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/992cf38e/src/fabric_view.erl
----------------------------------------------------------------------
diff --git a/src/fabric_view.erl b/src/fabric_view.erl
index 7cd5321..32369cd 100644
--- a/src/fabric_view.erl
+++ b/src/fabric_view.erl
@@ -306,10 +306,11 @@ get_shards(DbName, #mrargs{stale=Stale})
 get_shards(DbName, #mrargs{stale=false}) ->
     mem3:shards(DbName).
 
-get_shard_replacements(DbName, UsedShards) ->
+get_shard_replacements(DbName, UsedShards0) ->
     % We only want to generate a replacements list from shards
     % that aren't already used.
     AllLiveShards = mem3:live_shards(DbName, [node() | nodes()]),
+    UsedShards = [S#shard{ref=undefined} || S <- UsedShards0],
     UnusedShards = AllLiveShards -- UsedShards,
 
     % If we have more than one copy of a range then we don't


Mime
View raw message