You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2021/10/28 21:01:09 UTC
[couchdb] branch chewbranca-ioq-experiments-segmented updated: Fix
segmented cache setup
This is an automated email from the ASF dual-hosted git repository.
chewbranca pushed a commit to branch chewbranca-ioq-experiments-segmented
in repository https://gitbox.apache.org/repos/asf/couchdb.git
The following commit(s) were added to refs/heads/chewbranca-ioq-experiments-segmented by this push:
new efd3a02 Fix segmented cache setup
efd3a02 is described below
commit efd3a0223e1c958b04e9df746a301d6e2870c784
Author: Russell Branca <ch...@apache.org>
AuthorDate: Thu Oct 28 13:57:24 2021 -0700
Fix segmented cache setup
---
src/couch/src/couch_file.erl | 6 +++---
src/couch/src/couch_sup.erl | 3 ++-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/couch/src/couch_file.erl b/src/couch/src/couch_file.erl
index 171c3e3..1645fd3 100644
--- a/src/couch/src/couch_file.erl
+++ b/src/couch/src/couch_file.erl
@@ -82,8 +82,8 @@ open(Filepath, Options, IOQPid0) ->
IOQPid0 when is_pid(IOQPid0) ->
IOQPid0
end,
- {Tab, Ref} = gen_server:call(Fd, get_cache_ref),
- {ok, #ioq_file{fd=Fd, ioq=IOQPid, tab=Tab, id_ref=Ref}};
+ {Tab, IdRef} = gen_server:call(Fd, get_cache_ref),
+ {ok, #ioq_file{fd=Fd, ioq=IOQPid, tab=Tab, id_ref=IdRef}};
ignore ->
% get the error
receive
@@ -448,7 +448,7 @@ init({Filepath, Options, ReturnPid, Ref}) ->
IsSys = lists:member(sys_db, Options),
update_read_timestamp(),
IdRef = make_ref(),
- Tab = case config:get("couchdb", "couch_file_cache", "true") of
+ Tab = case config:get("couchdb", "couch_file_cache", "segmented") of
"true" ->
couch_stats:increment_counter([couchdb, couch_file, cache_opens]),
ets:new(?MODULE, [set, protected, {read_concurrency, true}]);
diff --git a/src/couch/src/couch_sup.erl b/src/couch/src/couch_sup.erl
index d58286e..f48cc93 100644
--- a/src/couch/src/couch_sup.erl
+++ b/src/couch/src/couch_sup.erl
@@ -44,10 +44,11 @@ start_link() ->
init(_Args) ->
+ TTL = config:get_integer("couchdb", "couch_file_ttl", 1000),
CacheArgs = #{
strategy => lru,
segment_num => 3,
- ttl => {milliseconds, 1000}
+ ttl => {milliseconds, TTL}
},
couch_log:info("Starting ~s", [?MODULE]),
{ok, {{one_for_one,10, 60}, [