diff options
author | jiangph <jiangph@cn.ibm.com> | 2019-08-22 17:28:38 +0800 |
---|---|---|
committer | jiangph <jiangph@cn.ibm.com> | 2019-11-05 08:50:07 +0800 |
commit | 367d17aebf8954ca2204823af34022280472869a (patch) | |
tree | e0625d7b1a20bdc8ef6cbf1fb514c9f5faf02a25 | |
parent | b9aa4e81815c38859edbb3b19e2a3639c30e9b1f (diff) | |
download | couchdb-367d17aebf8954ca2204823af34022280472869a.tar.gz |
close LRU by database pathclose-lru
-rw-r--r-- | src/dreyfus/src/clouseau_rpc.erl | 7 | ||||
-rw-r--r-- | src/dreyfus/src/dreyfus_index_manager.erl | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/dreyfus/src/clouseau_rpc.erl b/src/dreyfus/src/clouseau_rpc.erl index b8190b32c..215adaee9 100644 --- a/src/dreyfus/src/clouseau_rpc.erl +++ b/src/dreyfus/src/clouseau_rpc.erl @@ -22,7 +22,7 @@ -export([group1/7, group2/2]). -export([delete/2, update/3, cleanup/1, cleanup/2, rename/1]). -export([analyze/2, version/0, disk_size/1]). --export([set_purge_seq/2, get_purge_seq/1, get_root_dir/0]). +-export([set_purge_seq/2, get_purge_seq/1, get_root_dir/0, close_lru/0, close_lru/1]). -export([connected/0]). open_index(Peer, Path, Analyzer) -> @@ -32,6 +32,10 @@ disk_size(Path) -> rpc({main, clouseau()}, {disk_size, Path}). get_root_dir() -> rpc({main, clouseau()}, {get_root_dir}). +close_lru() -> + rpc({main, clouseau()}, {close_lru}). +close_lru(DbName) -> + rpc({main, clouseau()}, {close_lru_by_path, DbName}). await(Ref, MinSeq) -> rpc(Ref, {await, MinSeq}). @@ -81,6 +85,7 @@ cleanup(DbName) -> gen_server:cast({cleanup, clouseau()}, {cleanup, DbName}). rename(DbName) -> + close_lru(DbName), gen_server:cast({cleanup, clouseau()}, {rename, DbName}). cleanup(DbName, ActiveSigs) -> diff --git a/src/dreyfus/src/dreyfus_index_manager.erl b/src/dreyfus/src/dreyfus_index_manager.erl index 47f254243..e0fee5e40 100644 --- a/src/dreyfus/src/dreyfus_index_manager.erl +++ b/src/dreyfus/src/dreyfus_index_manager.erl @@ -123,6 +123,7 @@ handle_db_event(DbName, deleted, _St) -> "enable_database_recovery", false), case RecoveryEnabled of true -> + clouseau_rpc:close_lru(DbName), gen_server:cast(?MODULE, {rename, DbName}); false -> gen_server:cast(?MODULE, {cleanup, DbName}) |