davisp commented on a change in pull request #635: Stop indexing activity on
ddoc update
URL: https://github.com/apache/couchdb/pull/635#discussion_r127492345
##########
File path: src/couch_index/src/couch_index_server.erl
##########
@@ -257,6 +257,12 @@ handle_db_event(<<"shards/", _/binary>> = DbName,
{ddoc_updated,
couch_db:open_doc(Db, DDocId, [ejson_body, ?ADMIN_CTX])
end),
DbShards = [mem3:name(Sh) || Sh <- mem3:local_shards(mem3:dbname(DbName))],
+ % Send ddoc_updated message to all couch_index processes for this DDoc,
+ % with the intention to close them.
+ % There can be other DDocs with the same Signature, served by the
+ % same couch_index processes, but the possibility for it is low,
+ % the negative effect is minor, and the check itself is expensive,
+ % => this check is skipped.
Review comment:
This is slightly worrisome as we have an established pattern of creating
identical design docs to create views in the background without disrupting
production. When we go to swap the design docs (ie, update old design doc to
contents of new version, and then delete the old version) this would cause a
non trivial amount of interruption to requests in progress.
I assume when you say that the check is expensive you're referring to the
cost of looking up every design document and calculating signatures to see if
we have duplicates. I wonder if a slight modification to just keep track of
alternate design document names when opening the index would be useful here.
That sort of "alias list" would have been useful a number of times that I can
remember when debugging various customer issues. Then that makes the check
something more along the lines of "if length(alias_list) == 1" which would be
sufficiently cheap.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services