commit | 88ff6d323f904425f5130a237ce712b68ac70dfb | [log] [tgz] |
---|---|---|
author | Mike Wallace <mikewallace@apache.org> | Wed Sep 10 12:14:30 2014 +0100 |
committer | Mike Wallace <mikewallace@apache.org> | Wed Sep 10 12:17:46 2014 +0100 |
tree | 198966ab09e42f50045b841d91db3b405b0161d0 | |
parent | f600e07864b15403a5d627fd3a633c5e4c7e3f24 [diff] |
Teach fabric_util:get_db/2 about maintenance mode If the node servicing a request does not have a shard for the db involved then fabric_util:get_db/2 can return a shard from a node which is in maintenance mode. If that node is a replacement node that has not yet been brought into the cluster then the security object will be empty. Because fabric:get_security/2 calls fabric_util:get_db/2 and is in the code path for authorizing requests at the HTTP layer, this can result in live nodes returning 403s. This commit replaces an rpc:call/4 with a rexi:cast/4 and adds a new rpc endpoint in fabric_rpc for opening single shards. This uses set_io_priority which will reply with a rexi_EXIT if maintenance mode is set. Closes COUCHDB-2325
Fabric is a collection of proxy functions for CouchDB operations in a cluster. These functions are used in BigCouch as the remote procedure endpoints on each of the cluster nodes.
For example, creating a database is a straightforward task in standalone CouchDB, but for BigCouch, each node that will store a shard for the database needs to receive and execute a fabric function. The node handling the request also needs to compile the results from each of the nodes and respond accordingly to the client.
Fabric is used in conjunction with ‘Rexi’ which is also an application within BigCouch.
Fabric requires R13B03 or higher and can be built with rebar, which comes bundled in the repository.