You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by da...@apache.org on 2014/02/05 00:06:17 UTC
[04/50] couch commit: updated refs/heads/import to c3116d7
Skip ddoc pull, use middleman for validation reset
We were pulling a list of design documents and then ignoring the result
when the #db was a partition of a clustered database. Also, the call to
fabric:reset_validation_funs/1 can occasionally cause a stray rexi_EXIT
message to arrive in the db_updater mailbox (and subsequently kill the
server) if a worker fails. I don't think that's desired behavior,
though it's a debatable point. This patch spawns a middleman process to
act as a sink for those stray messages.
BugzID: 13087
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/0514f49b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/0514f49b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/0514f49b
Branch: refs/heads/import
Commit: 0514f49bc8ffda95ab091ea7742b71b85ec116dd
Parents: 30b7c47
Author: Adam Kocoloski <ad...@cloudant.com>
Authored: Thu Dec 29 23:07:06 2011 -0500
Committer: Paul J. Davis <pa...@gmail.com>
Committed: Tue Feb 4 17:03:23 2014 -0600
----------------------------------------------------------------------
src/couch_db_updater.erl | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0514f49b/src/couch_db_updater.erl
----------------------------------------------------------------------
diff --git a/src/couch_db_updater.erl b/src/couch_db_updater.erl
index 5a11650..414e3a0 100644
--- a/src/couch_db_updater.erl
+++ b/src/couch_db_updater.erl
@@ -526,6 +526,9 @@ close_db(#db{fd_monitor = Ref}) ->
erlang:demonitor(Ref).
+refresh_validate_doc_funs(#db{name = <<"shards/", _/binary>> = Name} = Db) ->
+ spawn(fabric, reset_validation_funs, [mem3:dbname(Name)]),
+ Db#db{validate_doc_funs = undefined};
refresh_validate_doc_funs(Db0) ->
Db = Db0#db{user_ctx = #user_ctx{roles=[<<"_admin">>]}},
{ok, DesignDocs} = couch_db:get_design_docs(Db),
@@ -538,13 +541,7 @@ refresh_validate_doc_funs(Db0) ->
Fun -> [Fun]
end
end, DesignDocs),
- case Db#db.name of
- <<"shards/", _:18/binary, DbName/binary>> ->
- fabric:reset_validation_funs(DbName),
- Db#db{validate_doc_funs=undefined};
- _ ->
- Db0#db{validate_doc_funs=ProcessDocFuns}
- end.
+ Db#db{validate_doc_funs=ProcessDocFuns}.
% rev tree functions