couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kocol...@apache.org
Subject [04/50] fabric commit: updated refs/heads/2971-count-distinct to 5d18415
Date Wed, 01 Mar 2017 16:38:02 GMT
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 <rnewson@apache.org>
Authored: Tue Jul 12 12:06:24 2016 +0100
Committer: Robert Newson <rnewson@apache.org>
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) ->


Mime
View raw message