summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAdam Kocoloski <adam@cloudant.com>2010-08-27 10:35:28 -0400
committerAdam Kocoloski <adam@cloudant.com>2010-08-27 16:34:31 -0400
commitc47b5baa8df9704fd4a1df495ed662614f424848 (patch)
treef52f0525ffedcb046307b7d74dbe8d0ad9339c9c /apps
parentef97f6583d5c6be6d0319a2367c4388426d04e82 (diff)
display full cluster update_seq in get_db_info()
Diffstat (limited to 'apps')
-rw-r--r--apps/fabric/src/fabric_db_info.erl11
-rw-r--r--apps/fabric/src/fabric_view_changes.erl2
2 files changed, 8 insertions, 5 deletions
diff --git a/apps/fabric/src/fabric_db_info.erl b/apps/fabric/src/fabric_db_info.erl
index e268c48c..a0acb379 100644
--- a/apps/fabric/src/fabric_db_info.erl
+++ b/apps/fabric/src/fabric_db_info.erl
@@ -31,13 +31,18 @@ handle_message({ok, Info}, #shard{dbname=Name} = Shard, {Counters, Acc}) ->
% already heard from someone else in this range
{ok, {Counters, Acc}};
nil ->
- C1 = fabric_dict:store(Shard, ok, Counters),
+ Seq = couch_util:get_value(update_seq, Info),
+ C1 = fabric_dict:store(Shard, Seq, Counters),
C2 = fabric_view:remove_overlapping_shards(Shard, C1),
case fabric_dict:any(nil, C2) of
true ->
{ok, {C2, [Info|Acc]}};
false ->
- {stop, [{db_name,Name}|merge_results(lists:flatten([Info|Acc]))]}
+ {stop, [
+ {db_name,Name},
+ {update_seq, fabric_view_changes:pack_seqs(C2)} |
+ merge_results(lists:flatten([Info|Acc]))
+ ]}
end
end;
handle_message(_, _, Acc) ->
@@ -51,8 +56,6 @@ merge_results(Info) ->
[{doc_count, lists:sum(X)} | Acc];
(doc_del_count, X, Acc) ->
[{doc_del_count, lists:sum(X)} | Acc];
- (update_seq, X, Acc) ->
- [{update_seq, lists:sum(X)} | Acc];
(purge_seq, X, Acc) ->
[{purge_seq, lists:sum(X)} | Acc];
(compact_running, X, Acc) ->
diff --git a/apps/fabric/src/fabric_view_changes.erl b/apps/fabric/src/fabric_view_changes.erl
index 865a2c8a..e4f44485 100644
--- a/apps/fabric/src/fabric_view_changes.erl
+++ b/apps/fabric/src/fabric_view_changes.erl
@@ -14,7 +14,7 @@
-module(fabric_view_changes).
--export([go/5, start_update_notifier/1]).
+-export([go/5, start_update_notifier/1, pack_seqs/1]).
-include("fabric.hrl").
-include_lib("mem3/include/mem3.hrl").