You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2014/08/01 16:30:01 UTC

[21/23] fabric commit: updated refs/heads/windsor-merge to 4ec3f11

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/828faf5b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/828faf5b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/828faf5b

Branch: refs/heads/windsor-merge
Commit: 828faf5b41e3291a5e9ce0a96e1b395affd1277d
Parents: 11f4d86
Author: Paul J. Davis <pa...@gmail.com>
Authored: Wed Mar 12 02:25:35 2014 -0400
Committer: Robert Newson <rn...@apache.org>
Committed: Fri Aug 1 15:26:58 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/828faf5b/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