Update all view/search index shards on ddoc update This update is part of the fix to trigger view/search index updates for all shards when a ddoc is updated. In the past, we only triggered indexing jobs for shards which contained the ddoc. Other parts of the fix are in ken and fabric. This particular commit contains the following:
- A new couch_db_update event, which will be used in ken to spawn indexing jobs. - A new function clause for the local _changes feed couch_db_update handler. This function clause will cause the _changes feed handler to ignore the aforementioned new couch_db_update event. BugzID: 10979 Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/088ded69 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/088ded69 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/088ded69 Branch: refs/heads/windsor-merge-209 Commit: 088ded691a04faa1c679ce5df1038df79ff8f89a Parents: a74e7a0 Author: Benjamin Bastian <[email protected]> Authored: Wed Mar 13 17:10:05 2013 -0700 Committer: Robert Newson <[email protected]> Committed: Mon Aug 4 14:16:55 2014 +0100 ---------------------------------------------------------------------- src/couch_changes.erl | 2 +- src/couch_db_updater.erl | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/088ded69/src/couch_changes.erl ---------------------------------------------------------------------- diff --git a/src/couch_changes.erl b/src/couch_changes.erl index d8b5320..fd14f3d 100644 --- a/src/couch_changes.erl +++ b/src/couch_changes.erl @@ -79,7 +79,7 @@ handle_changes(Args1, Req, Db0) -> {Callback, UserAcc} = get_callback_acc(CallbackAcc), Self = self(), {ok, Notify} = couch_db_update_notifier:start_link( - fun({_, DbName}) when Db0#db.name == DbName -> + fun({updated, DbName}) when Db0#db.name == DbName -> Self ! db_updated; (_) -> ok http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/088ded69/src/couch_db_updater.erl ---------------------------------------------------------------------- diff --git a/src/couch_db_updater.erl b/src/couch_db_updater.erl index 330f8cb..1b20544 100644 --- a/src/couch_db_updater.erl +++ b/src/couch_db_updater.erl @@ -738,6 +738,8 @@ update_docs_int(Db, DocsList, NonRepDocs, MergeConflicts, FullCommit) -> % funs if we did. Db4 = case length(UpdatedDDocIds) > 0 of true -> + couch_db_update_notifier:notify( + {ddoc_updated, Db3#db.name}), ddoc_cache:evict(Db3#db.name, UpdatedDDocIds), refresh_validate_doc_funs(Db3); false ->
