You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ji...@apache.org on 2019/11/21 05:51:46 UTC
[couchdb] branch refactor-soft-deletion-searchindex created (now
72faf5d)
This is an automated email from the ASF dual-hosted git repository.
jiangphcn pushed a change to branch refactor-soft-deletion-searchindex
in repository https://gitbox.apache.org/repos/asf/couchdb.git.
at 72faf5d refactor soft deletion of search index
This branch includes the following new commits:
new 72faf5d refactor soft deletion of search index
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[couchdb] 01/01: refactor soft deletion of search index
Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jiangphcn pushed a commit to branch refactor-soft-deletion-searchindex
in repository https://gitbox.apache.org/repos/asf/couchdb.git
View the commit online:
https://github.com/apache/couchdb/commit/72faf5dc78f516f255a03925c07af13fe156af76
commit 72faf5dc78f516f255a03925c07af13fe156af76
Author: jiangph <ji...@cn.ibm.com>
AuthorDate: Thu Nov 21 13:48:38 2019 +0800
refactor soft deletion of search index
---
src/dreyfus/src/clouseau_rpc.erl | 9 ++++-----
src/dreyfus/src/dreyfus_index_manager.erl | 7 +------
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/src/dreyfus/src/clouseau_rpc.erl b/src/dreyfus/src/clouseau_rpc.erl
index 215adae..10ff566 100644
--- a/src/dreyfus/src/clouseau_rpc.erl
+++ b/src/dreyfus/src/clouseau_rpc.erl
@@ -20,7 +20,7 @@
-export([open_index/3]).
-export([await/2, commit/2, get_update_seq/1, info/1, search/2]).
-export([group1/7, group2/2]).
--export([delete/2, update/3, cleanup/1, cleanup/2, rename/1]).
+-export([delete/2, soft_delete/1, update/3, cleanup/1, cleanup/2]).
-export([analyze/2, version/0, disk_size/1]).
-export([set_purge_seq/2, get_purge_seq/1, get_root_dir/0, close_lru/0, close_lru/1]).
-export([connected/0]).
@@ -78,16 +78,15 @@ group2(Ref, Args) ->
delete(Ref, Id) ->
rpc(Ref, {delete, couch_util:to_binary(Id)}).
+soft_delete(DbName) ->
+ rpc({main, clouseau()}, {soft_delete, DbName}).
+
update(Ref, Id, Fields) ->
rpc(Ref, {update, Id, Fields}).
cleanup(DbName) ->
gen_server:cast({cleanup, clouseau()}, {cleanup, DbName}).
-rename(DbName) ->
- close_lru(DbName),
- gen_server:cast({cleanup, clouseau()}, {rename, DbName}).
-
cleanup(DbName, ActiveSigs) ->
gen_server:cast({cleanup, clouseau()}, {cleanup, DbName, ActiveSigs}).
diff --git a/src/dreyfus/src/dreyfus_index_manager.erl b/src/dreyfus/src/dreyfus_index_manager.erl
index e0fee5e..b37c8aa 100644
--- a/src/dreyfus/src/dreyfus_index_manager.erl
+++ b/src/dreyfus/src/dreyfus_index_manager.erl
@@ -82,10 +82,6 @@ handle_call({open_error, DbName, Sig, Error}, {OpenerPid, _}, State) ->
handle_cast({cleanup, DbName}, State) ->
clouseau_rpc:cleanup(DbName),
- {noreply, State};
-
-handle_cast({rename, DbName}, State) ->
- clouseau_rpc:rename(DbName),
{noreply, State}.
handle_info({'EXIT', FromPid, Reason}, State) ->
@@ -123,8 +119,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});
+ clouseau_rpc:soft_delete(DbName);
false ->
gen_server:cast(?MODULE, {cleanup, DbName})
end,