You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2016/07/12 13:59:43 UTC

fabric commit: updated refs/heads/master to ebea1b8

Repository: couchdb-fabric
Updated Branches:
  refs/heads/master 7d0787785 -> ebea1b8f5


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/master
Commit: ebea1b8f5d49fe60f326b33dbdc06176ecfea5d1
Parents: 7d07877
Author: Robert Newson <rn...@apache.org>
Authored: Tue Jul 12 12:06:24 2016 +0100
Committer: Robert Newson <rn...@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) ->