couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [24/50] fabric commit: updated refs/heads/windsor-merge-121 to 79e6e2f
Date Fri, 01 Aug 2014 09:12:12 GMT
Change write quorum error logs into metrics

The global_changes work uncovered the fact that the common "write quourm
failed" log messages happen for run of the mill conflict errors. Rather
than try and change the logic around to fix the error this just adds
three metrics to cover the events so that we can monitor it in the
future.

BugzId: 23977


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

Branch: refs/heads/windsor-merge-121
Commit: feb5694941f7adc310f937b71f5cd9e834c20990
Parents: 455afa7
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
Authored: Tue Oct 8 12:03:23 2013 -0400
Committer: Robert Newson <rnewson@apache.org>
Committed: Thu Jul 31 13:43:28 2014 +0100

----------------------------------------------------------------------
 src/fabric_doc_update.erl | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/feb56949/src/fabric_doc_update.erl
----------------------------------------------------------------------
diff --git a/src/fabric_doc_update.erl b/src/fabric_doc_update.erl
index 9e2ce50..91a3c23 100644
--- a/src/fabric_doc_update.erl
+++ b/src/fabric_doc_update.erl
@@ -112,17 +112,22 @@ force_reply(Doc, [FirstReply|_] = Replies, {Health, W, Acc}) ->
     {true, Reply} ->
         {Health, W, [{Doc,Reply} | Acc]};
     false ->
-        couch_log:warning("write quorum (~p) failed for ~s", [W, Doc#doc.id]),
         case [Reply || {ok, Reply} <- Replies] of
         [] ->
             % check if all errors are identical, if so inherit health
             case lists:all(fun(E) -> E =:= FirstReply end, Replies) of
             true ->
+                CounterKey = [fabric, doc_update, errors],
+                margaret_counter:increment(CounterKey),
                 {Health, W, [{Doc, FirstReply} | Acc]};
             false ->
+                CounterKey = [fabric, doc_update, mismatched_errors],
+                margaret_counter:increment(CounterKey),
                 {error, W, [{Doc, FirstReply} | Acc]}
             end;
         [AcceptedRev | _] ->
+            CounterKey = [fabric, doc_update, write_quorum_errors],
+            margaret_counter:increment(CounterKey),
             NewHealth = case Health of ok -> accepted; _ -> Health end,
             {NewHealth, W, [{Doc, {accepted,AcceptedRev}} | Acc]}
         end


Mime
View raw message