Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4DA2D200B5C for ; Thu, 11 Aug 2016 13:28:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4C509160AB4; Thu, 11 Aug 2016 11:28:26 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9B72D160A85 for ; Thu, 11 Aug 2016 13:28:25 +0200 (CEST) Received: (qmail 9887 invoked by uid 500); 11 Aug 2016 11:28:24 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 9874 invoked by uid 99); 11 Aug 2016 11:28:24 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Aug 2016 11:28:24 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B2BDCE0007; Thu, 11 Aug 2016 11:28:24 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rnewson@apache.org To: commits@couchdb.apache.org Date: Thu, 11 Aug 2016 11:28:24 -0000 Message-Id: <853cb5a2cbf14089afbd49df191c4395@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] fabric commit: updated refs/heads/master to 78eb096 archived-at: Thu, 11 Aug 2016 11:28:26 -0000 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 Authored: Wed Aug 19 12:09:16 2015 -0400 Committer: Mayya Sharipova 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) ->