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:34:29 UTC

[08/49] fabric commit: updated refs/heads/windsor-merge to b1c0030

Replace read_repair logs with a metric

Successful read repair notices aren't overly informative. To reduce log
spam we'll just switch to using a metric and only log when we don't have
a successful response.

BugzId: 24262


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

Branch: refs/heads/windsor-merge
Commit: a505676b072e59814f59bdb46a1856d8df79c77b
Parents: 865b555
Author: Paul J. Davis <pa...@gmail.com>
Authored: Thu Oct 17 15:35:39 2013 -0500
Committer: Robert Newson <rn...@apache.org>
Committed: Fri Aug 1 15:33:41 2014 +0100

----------------------------------------------------------------------
 src/fabric_doc_open.erl      | 7 ++++++-
 src/fabric_doc_open_revs.erl | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/a505676b/src/fabric_doc_open.erl
----------------------------------------------------------------------
diff --git a/src/fabric_doc_open.erl b/src/fabric_doc_open.erl
index 77b6337..26bd2a3 100644
--- a/src/fabric_doc_open.erl
+++ b/src/fabric_doc_open.erl
@@ -120,7 +120,12 @@ read_repair(#acc{dbname=DbName, replies=Replies}) ->
         Ctx = #user_ctx{roles=[<<"_admin">>]},
         Opts = [replicated_changes, {user_ctx, Ctx}],
         Res = fabric:update_docs(DbName, Docs, Opts),
-        couch_log:notice("read_repair ~s ~s ~p", [DbName, Id, Res]),
+        case Res of
+            {ok, []} ->
+                ok;
+            _ ->
+                couch_log:notice("read_repair ~s ~s ~p", [DbName, Id, Res])
+        end,
         choose_reply(Docs);
     [] ->
         % Try hard to return some sort of information

http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/a505676b/src/fabric_doc_open_revs.erl
----------------------------------------------------------------------
diff --git a/src/fabric_doc_open_revs.erl b/src/fabric_doc_open_revs.erl
index 662990a..31d7616 100644
--- a/src/fabric_doc_open_revs.erl
+++ b/src/fabric_doc_open_revs.erl
@@ -167,7 +167,12 @@ maybe_execute_read_repair(Db, Docs) ->
     [#doc{id=Id} | _] = Docs,
     Ctx = #user_ctx{roles=[<<"_admin">>]},
     Res = fabric:update_docs(Db, Docs, [replicated_changes, {user_ctx,Ctx}]),
-    couch_log:notice("read_repair ~s ~s ~p", [Db, Id, Res]).
+    case Res of
+        {ok, []} ->
+            ok;
+        _ ->
+            couch_log:notice("read_repair ~s ~s ~p", [Db, Id, Res])
+    end.
 
 % hackery required so that not_found sorts first
 strip_not_found_missing([]) ->