You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by gi...@git.apache.org on 2017/04/27 19:33:16 UTC

[GitHub] iilyak commented on a change in pull request #497: notify couch_index_processes on all shards when ddoc updated

iilyak commented on a change in pull request #497: notify couch_index_processes on all shards when ddoc updated
URL: https://github.com/apache/couchdb/pull/497#discussion_r113783048
 
 

 ##########
 File path: src/couch_index/src/couch_index_server.erl
 ##########
 @@ -252,14 +252,20 @@ handle_db_event(DbName, deleted, St) ->
     gen_server:cast(?MODULE, {reset_indexes, DbName}),
     {ok, St};
 handle_db_event(DbName, {ddoc_updated, DDocId}, St) ->
-    lists:foreach(fun({_DbName, {_DDocId, Sig}}) ->
-        case ets:lookup(?BY_SIG, {DbName, Sig}) of
-            [{_, IndexPid}] ->
-                (catch gen_server:cast(IndexPid, ddoc_updated));
-            [] ->
-                ok
-        end
-    end, ets:match_object(?BY_DB, {DbName, {DDocId, '$1'}})),
+    DDocResult = couch_util:with_db(DbName, fun(Db) ->
+        couch_db:open_doc(Db, DDocId, [ejson_body, ?ADMIN_CTX])
+    end),
+    DbNames = [mem3:name(Sh) || Sh <- mem3:local_shards(mem3:dbname(DbName))],
+    lists:foreach(
+        fun(DBName) ->
+        lists:foreach(fun({_DBName, {_DDocId, Sig}}) ->
 
 Review comment:
   I think the indentation is wrong here (it should not be lined up with `fun(DbName) ->` IMO).
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services