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 B1F70200C2A for ; Wed, 1 Mar 2017 17:38:01 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id B0A2B160B82; Wed, 1 Mar 2017 16:38:01 +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 C2FB1160B7F for ; Wed, 1 Mar 2017 17:38:00 +0100 (CET) Received: (qmail 72981 invoked by uid 500); 1 Mar 2017 16:37:59 -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 72849 invoked by uid 99); 1 Mar 2017 16:37:59 -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; Wed, 01 Mar 2017 16:37:59 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A9983E00B7; Wed, 1 Mar 2017 16:37:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kocolosk@apache.org To: commits@couchdb.apache.org Date: Wed, 01 Mar 2017 16:38:02 -0000 Message-Id: In-Reply-To: <925479a7649544f8927df3a0988e9cee@git.apache.org> References: <925479a7649544f8927df3a0988e9cee@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [04/50] fabric commit: updated refs/heads/2971-count-distinct to 5d18415 archived-at: Wed, 01 Mar 2017 16:38:01 -0000 End the listener if any shard is deleted If a database is deleted and recreated the underlying shards have a new name. Since we're watching the old names, we will never again see an updated event. So, we stop this process if any watched shard is deleted and it's someone elses job to recreate the listener for the new shards. COUCHDB-3054 Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/ebea1b8f Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/ebea1b8f Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/ebea1b8f Branch: refs/heads/2971-count-distinct Commit: ebea1b8f5d49fe60f326b33dbdc06176ecfea5d1 Parents: 7d07877 Author: Robert Newson Authored: Tue Jul 12 12:06:24 2016 +0100 Committer: Robert Newson Committed: Tue Jul 12 12:08:38 2016 +0100 ---------------------------------------------------------------------- src/fabric_db_update_listener.erl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/ebea1b8f/src/fabric_db_update_listener.erl ---------------------------------------------------------------------- diff --git a/src/fabric_db_update_listener.erl b/src/fabric_db_update_listener.erl index f0155de..ba9111d 100644 --- a/src/fabric_db_update_listener.erl +++ b/src/fabric_db_update_listener.erl @@ -83,7 +83,9 @@ start_update_notifier(DbNames) -> handle_db_event(_DbName, updated, #cb_state{notify = true} = St) -> erlang:send(St#cb_state.client_pid, {St#cb_state.client_ref, db_updated}), {ok, St}; -handle_db_event(_DbName, _Event, St) -> +handle_db_event(_DbName, deleted, St) -> + {stop, St}; +handle_db_event(DbName, Event, St) -> {ok, St}. start_cleanup_monitor(Parent, Notifiers) ->