|author||Mike Wallace <firstname.lastname@example.org>||Wed Sep 10 12:14:30 2014 +0100|
|committer||Mike Wallace <email@example.com>||Wed Sep 10 12:17:46 2014 +0100|
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
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.