You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2017/04/13 17:00:10 UTC
[couchdb] branch COUCHDB-3287-pluggable-storage-engines updated:
DEBUG: Update log messages for cache operations
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 10e29d9 DEBUG: Update log messages for cache operations
10e29d9 is described below
commit 10e29d911aaa3c5d0d9cad5e7d69aa5a55962ae8
Author: Paul J. Davis <pa...@gmail.com>
AuthorDate: Thu Apr 13 11:59:59 2017 -0500
DEBUG: Update log messages for cache operations
---
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 621bdaf..b26baf8 100644
--- a/src/mem3/src/mem3_shards.erl
+++ b/src/mem3/src/mem3_shards.erl
@@ -215,7 +215,6 @@ handle_cast({cache_insert, DbName, Shards, UpdateSeq}, St) ->
couch_log:notice("~p ignoring add ~s :: ~p < ~p", [?MODULE, DbName, UpdateSeq, St#st.update_seq]),
St;
false ->
- couch_log:notice("~p adding ~s :: ~p >= ~p", [?MODULE, DbName, UpdateSeq, St#st.update_seq]),
cache_free(cache_insert(St, DbName, Shards))
end,
{noreply, NewSt};
@@ -397,11 +396,13 @@ cache_insert(#st{cur_size=Cur}=St, DbName, Shards) ->
true = ets:insert(?SHARDS, Shards),
case ets:lookup(?DBS, DbName) of
[{DbName, ATime}] ->
+ couch_log:notice("~p cache_insert ~s :: ~p :: ~p -> ~p", [?MODULE, DbName, St, ATime, NewATime]),
true = ets:delete(?ATIMES, ATime),
true = ets:insert(?ATIMES, {NewATime, DbName}),
true = ets:insert(?DBS, {DbName, NewATime}),
St;
[] ->
+ couch_log:notice("~p cache_insert ~s :: ~p :: ~p", [?MODULE, DbName, St, NewATime]),
true = ets:insert(?ATIMES, {NewATime, DbName}),
true = ets:insert(?DBS, {DbName, NewATime}),
St#st{cur_size=Cur + 1}
@@ -411,10 +412,12 @@ cache_remove(#st{cur_size=Cur}=St, DbName) ->
true = ets:delete(?SHARDS, DbName),
case ets:lookup(?DBS, DbName) of
[{DbName, ATime}] ->
+ couch_log:notice("~p cache_remove ~s :: ~p :: ~p", [?MODULE, DbName, St, ATime]),
true = ets:delete(?DBS, DbName),
true = ets:delete(?ATIMES, ATime),
St#st{cur_size=Cur-1};
[] ->
+ couch_log:notice("~p cache_remove ~s :: ~p :: not_found", [?MODULE, DbName, St]),
St
end.
@@ -433,6 +436,7 @@ 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),
+ couch_log:notice("~p cache_free ~s :: ~p :: ~p", [?MODULE, DbName, St, ATime]),
true = ets:delete(?ATIMES, ATime),
true = ets:delete(?DBS, DbName),
true = ets:delete(?SHARDS, DbName),
@@ -441,6 +445,7 @@ cache_free(St) ->
St.
cache_clear(St) ->
+ couch_log:notice("~p cache_clear :: ~p", [?MODULE, St]),
true = ets:delete_all_objects(?DBS),
true = ets:delete_all_objects(?SHARDS),
true = ets:delete_all_objects(?ATIMES),
--
To stop receiving notification emails like this one, please contact
['"commits@couchdb.apache.org" <co...@couchdb.apache.org>'].