Crates.io | cueball-manatee-primary-resolver |
lib.rs | cueball-manatee-primary-resolver |
version | 0.5.1 |
source | src |
created_at | 2020-01-08 22:41:34.49091 |
updated_at | 2020-05-19 19:59:40.665216 |
description | An implementation of the cueball Resolver trait that is specific to the Joyent manatee project. It queries a zookeeper cluster to determine the PostgreSQL replication primary from a set of PostgreSQL replication peers. |
homepage | |
repository | https://github.com/joyent/rust-cueball |
max_upload_size | |
id | 196727 |
size | 113,507 |
This is an implementation of the
cueball Resolver
trait that provides
a list of backends for use by the connection pool. See the cueball documentation
for more information.
This resolver is specific to the Joyent manatee project. It queries a zookeeper cluster to determine the PostgreSQL replication primary from a set of PostgreSQL replication peers.
The manatee-echo-resolver
binary, in /rust-cueball/tools/
, runs a manatee
primary resolver and prints its logging, as well as messages received over the
cueball channel, to standard out. This is useful for ad-hoc testing. Here's how
to build and run:
# Note that these paths are relative to the repository root
$ cd rust-cueball
$ cargo build
$ ./target/debug/echo-resolver --help
The test suite requires a running ZooKeeper instance with the following properties:
The easiest way to meet both of these criteria is to run the test suite on Joyent SmartOS and install ZooKeeper in your test zone via pkgsrc.
The ZooKeeper instance does not require any other setup ahead of time -- the test suite will handle the creation and deletion of test nodes with mock data.
To run the test suite, run cargo test
.
The amount of log output may be distracting. You can quell this by setting the
RESOLVER_LOG_LEVEL
to something high, perhaps critical
. The default log
level is info
. If you do want to look at the log output, you may want to pipe
it into bunyan for readability. Because
the tests run in parallel where it is safe to do so, their log output will
occasionally interleave, rendering it unparseable. If this is a nuisance, you
can run the tests consecutively using the instructions
here.