commit | 19e9959aab87c8050d280f5d255d58cf1a995614 | [log] [tgz] |
---|---|---|
author | ILYA Khlopotov <iilyak@ca.ibm.com> | Tue May 24 15:52:25 2016 -0700 |
committer | ILYA Khlopotov <iilyak@ca.ibm.com> | Tue May 24 15:52:25 2016 -0700 |
tree | c6df90410778812e7507eb79e422c8cef7cf41fc | |
parent | 475b90ccd104a1d2598a21338f02c433a10d62a7 [diff] |
Use meck:wait to fix race condition fabric:update_docs is running in the context of a `read_repair` which is an independent process started using `erlang:spawn/1`. This leads to a race when we try to use `meck:history(fabric)`. Use of `meck:wait` ensures that we call `meck:history` after `fabric:update_docs` has been called.
Fabric is a collection of proxy functions for CouchDB operations in a cluster. These functions are used in CouchDB as the remote procedure endpoints on each of the cluster nodes.
For example, creating a database is a straightforward task in CouchDB 1.x, but for a clustered CouchDB, 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 CouchDB.
Fabric requires R13B03 or higher and can be built with rebar.