Revert "Revert "Merge remote-tracking branch 'banjiewen/stale-stable-update'"" 78/head
authorILYA Khlopotov <iilyak@apache.org>
Mon, 14 Nov 2016 21:17:12 +0000 (13:17 -0800)
committerILYA Khlopotov <iilyak@apache.org>
Tue, 15 Nov 2016 00:06:52 +0000 (16:06 -0800)
This reverts commit a8e0e9549bb2a1181538ae433f1de78abadc41d5.

Note: Re-aplying previously reverted merge

src/fabric_view.erl

index a766348..01291a9 100644 (file)
@@ -302,14 +302,13 @@ index_of(X, [X|_Rest], I) ->
 index_of(X, [_|Rest], I) ->
     index_of(X, Rest, I+1).
 
-get_shards(DbName, #mrargs{stale=Stale})
-  when Stale == ok orelse Stale == update_after ->
+get_shards(DbName, #mrargs{stable=true}) ->
     mem3:ushards(DbName);
-get_shards(DbName, #mrargs{stale=false}) ->
+get_shards(DbName, #mrargs{stable=false}) ->
     mem3:shards(DbName).
 
 maybe_update_others(DbName, DDoc, ShardsInvolved, ViewName,
-    #mrargs{stale=update_after} = Args) ->
+    #mrargs{update=lazy} = Args) ->
     ShardsNeedUpdated = mem3:shards(DbName) -- ShardsInvolved,
     lists:foreach(fun(#shard{node=Node, name=ShardName}) ->
         rpc:cast(Node, fabric_rpc, update_mrview, [ShardName, DDoc, ViewName, Args])