couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject fabric commit: updated refs/heads/master to cc80c1e
Date Mon, 16 Jun 2014 14:49:50 GMT
Repository: couchdb-fabric
Updated Branches:
  refs/heads/master 4f9cc9e44 -> cc80c1e99


Support since=now


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

Branch: refs/heads/master
Commit: cc80c1e994e4969b172c23d0d27fc7e4cfe11533
Parents: 4f9cc9e
Author: Robert Newson <rnewson@apache.org>
Authored: Mon Jun 16 15:49:32 2014 +0100
Committer: Robert Newson <rnewson@apache.org>
Committed: Mon Jun 16 15:49:32 2014 +0100

----------------------------------------------------------------------
 src/fabric_view_changes.erl | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/cc80c1e9/src/fabric_view_changes.erl
----------------------------------------------------------------------
diff --git a/src/fabric_view_changes.erl b/src/fabric_view_changes.erl
index b6eb24b..d97017c 100644
--- a/src/fabric_view_changes.erl
+++ b/src/fabric_view_changes.erl
@@ -247,13 +247,14 @@ make_changes_args(#changes_args{style=Style, filter=undefined}=Args)
->
 make_changes_args(Args) ->
     Args.
 
-get_start_seq(_DbName, #changes_args{dir=fwd, since=Since}) ->
-    Since;
-get_start_seq(DbName, #changes_args{dir=rev}) ->
+get_start_seq(DbName, #changes_args{dir=Dir, since=Since})
+  when Dir == rev; Since == "now" ->
     Shards = mem3:shards(DbName),
     Workers = fabric_util:submit_jobs(Shards, get_update_seq, []),
-    {ok, Since} = fabric_util:recv(Workers, #shard.ref,
+    {ok, Seqs} = fabric_util:recv(Workers, #shard.ref,
         fun collect_update_seqs/3, fabric_dict:init(Workers, -1)),
+    Seqs;
+get_start_seq(_DbName, #changes_args{dir=fwd, since=Since}) ->
     Since.
 
 collect_update_seqs(Seq, Shard, Counters) when is_integer(Seq) ->
@@ -361,6 +362,8 @@ find_replacement_shards(#shard{range=Range}, AllShards) ->
     % TODO make this moar betta -- we might have split or merged the partition
     [Shard || Shard <- AllShards, Shard#shard.range =:= Range].
 
+validate_start_seq(_DbName, "now") ->
+    ok;
 validate_start_seq(DbName, Seq) ->
     try unpack_seqs(Seq, DbName) of _Any ->
         ok


Mime
View raw message