couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [couchdb] branch COUCHDB-3287-pluggable-storage-engines updated: DEBUG: Trying to figure out why mem3_shards backs up
Date Tue, 11 Apr 2017 21:37:44 GMT
This is an automated email from the ASF dual-hosted git repository.

davisp pushed a commit to branch COUCHDB-3287-pluggable-storage-engines
in repository https://gitbox.apache.org/repos/asf/couchdb.git

The following commit(s) were added to refs/heads/COUCHDB-3287-pluggable-storage-engines by
this push:
       new  aede995   DEBUG: Trying to figure out why mem3_shards backs up
aede995 is described below

commit aede99562c5691799db4cd2da8c7ad743206a756
Author: Paul J. Davis <paul.joseph.davis@gmail.com>
AuthorDate: Tue Apr 11 16:37:34 2017 -0500

    DEBUG: Trying to figure out why mem3_shards backs up
---
 src/mem3/src/mem3_shards.erl | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/mem3/src/mem3_shards.erl b/src/mem3/src/mem3_shards.erl
index 329f9ed..f7e7962 100644
--- a/src/mem3/src/mem3_shards.erl
+++ b/src/mem3/src/mem3_shards.erl
@@ -203,6 +203,7 @@ handle_cast({cache_hit, DbName}, St) ->
     cache_hit(DbName),
     {noreply, St};
 handle_cast({cache_insert, DbName, Shards, UpdateSeq}, St) ->
+    couch_log:notice("~p maybe adding ~s ~p ~p", [?MODULE, DbName, St#st.update_seq, UpdateSeq]),
     couch_stats:increment_counter([mem3, shard_cache, miss]),
     NewSt = case UpdateSeq < St#st.update_seq of
         true -> St;
@@ -211,6 +212,7 @@ handle_cast({cache_insert, DbName, Shards, UpdateSeq}, St) ->
     {noreply, NewSt};
 handle_cast({cache_remove, DbName}, St) ->
     couch_stats:increment_counter([mem3, shard_cache, eviction]),
+    couch_log:notice("~p removing ~s ~p", [?MODULE, DbName, St#st.update_seq]),
     {noreply, cache_remove(St, DbName)};
 handle_cast({cache_insert_change, DbName, Shards, UpdateSeq}, St) ->
     Msg = {cache_insert, DbName, Shards, UpdateSeq},
@@ -225,6 +227,7 @@ handle_cast(_Msg, St) ->
 handle_info({'DOWN', _, _, Pid, Reason}, #st{changes_pid=Pid}=St) ->
     {NewSt, Seq} = case Reason of
         {seq, EndSeq} ->
+            couch_log:notice("~p changes listener ended ~p", [?MODULE, EndSeq]),
             {St, EndSeq};
         shard_db_changed ->
             {cache_clear(St), get_update_seq()};
@@ -264,6 +267,7 @@ start_changes_listener(SinceSeq) ->
             end,
             exit(shutdown)
         end),
+        couch_log:notice("~p changes listener starting ~p", [?MODULE, SinceSeq]),
         listen_for_changes(SinceSeq)
     end),
     Pid.
@@ -417,6 +421,7 @@ cache_hit(DbName) ->
     end.
 
 cache_free(#st{max_size=Max, cur_size=Cur}=St) when Max =< Cur ->
+    couch_stats:increment_counter([mem3, shard_cache, eviction]),
     ATime = ets:first(?ATIMES),
     [{ATime, DbName}] = ets:lookup(?ATIMES, ATime),
     true = ets:delete(?ATIMES, ATime),
@@ -442,4 +447,4 @@ filter_shards_by_name(Name, Matches, [#ordered_shard{name=Name}=S|Ss])
->
 filter_shards_by_name(Name, Matches, [#shard{name=Name}=S|Ss]) ->
     filter_shards_by_name(Name, [S|Matches], Ss);
 filter_shards_by_name(Name, Matches, [_|Ss]) ->
-    filter_shards_by_name(Name, Matches, Ss).
+    filter_shards_by_name(Name, Matches, Ss).
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <commits@couchdb.apache.org>'].

Mime
View raw message