couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [44/50] fabric commit: updated refs/heads/windsor-merge-121 to 79e6e2f
Date Fri, 01 Aug 2014 09:12:32 GMT
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/49dd38c8
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/49dd38c8
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/49dd38c8

Branch: refs/heads/windsor-merge-121
Commit: 49dd38c8a39186e06a19e01757cf83ba7ae3fd82
Parents: f1d0c22
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Thu Oct 17 15:35:39 2013 -0500
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Jul 31 17:22:13 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/49dd38c8/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/49dd38c8/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([]) ->


Mime
View raw message