Repository: couchdb-fabric Updated Branches: refs/heads/master cb85279e0 -> 78eb096da
make _view_cleanup endpoint cluster aware Currently _view_cleanup endpoint is not cluster aware, only deletes indexes on the node that gets the request. This will make it cluster aware, deleting unused indexes on all nodes. JIRA: COUCHDB-2779 Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/b2afce7a Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/b2afce7a Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/b2afce7a Branch: refs/heads/master Commit: b2afce7a4efdc44cda9f74512de385af0c3cad8f Parents: 9335f03 Author: Mayya Sharipova <[email protected]> Authored: Wed Aug 19 12:09:16 2015 -0400 Committer: Mayya Sharipova <[email protected]> Committed: Wed Aug 19 12:09:16 2015 -0400 ---------------------------------------------------------------------- src/fabric.erl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/b2afce7a/src/fabric.erl ---------------------------------------------------------------------- diff --git a/src/fabric.erl b/src/fabric.erl index 07c4c9c..1d0312a 100644 --- a/src/fabric.erl +++ b/src/fabric.erl @@ -33,7 +33,7 @@ % miscellany -export([design_docs/1, reset_validation_funs/1, cleanup_index_files/0, - cleanup_index_files/1, dbname/1]). + cleanup_index_files/1, cleanup_index_files_all_nodes/1, dbname/1]). -include_lib("fabric/include/fabric.hrl"). @@ -439,8 +439,14 @@ cleanup_index_files(DbName) -> [file:delete(File) || File <- DeleteFiles], ok. -%% some simple type validation and transcoding +%% @doc clean up index files for a specific db on all nodes +-spec cleanup_index_files_all_nodes(dbname()) -> [reference()]. +cleanup_index_files_all_nodes(DbName) -> + lists:foreach(fun(Node) -> + rexi:cast(Node, {?MODULE, cleanup_index_files, [DbName]}) + end, mem3:nodes()). +%% some simple type validation and transcoding dbname(DbName) when is_list(DbName) -> list_to_binary(DbName); dbname(DbName) when is_binary(DbName) ->
