willholley opened a new pull request, #5588:
URL: https://github.com/apache/couchdb/pull/5588
## Overview
This adds a feature to populate the zone field in the `nodes` database by
setting the
`COUCHDB_ZONE` environment variable. Setting the zone for a node was
previously an awkward piece of cluster setup orchestration because it required
editing the a document on each of the local "nodes" after CouchDB has started
but before creating any other system databases.
This implementation reads the `COUCHDB_ZONE` environment variable when mem3
starts and, if present, updates the local node document with that zone string.
One nuance is that multiple nodes in the cluster might create the same first
revision of a node document due to the seedlist feature, which pre-emptively
adds the seeds to the nodes database. To prevent conflicts when the nodes
database is replicated between peers, the zone is set using an additional
update to the node document for the local node only.
Other things to note:
* We generally don't expect `COUCHDB_ZONE` to change in the lifetime of a
node, but the code does allow this.
* If `COUCHDB_ZONE` is not set, no modifications to the node document are
made.
## Testing recommendations
Eunit tests are added to verify the node document is as expected. You can
also test using:
```
COUCHDB_ZONE="zone1" ./dev/run
...
curl http://127.0.0.1:15984/_node/_local/_nodes/_all_docs?include_docs=true
```
## Related Issues or Pull Requests
<!-- If your changes affect multiple components in different
repositories please put links to those issues or pull requests here.
-->
## Checklist
- [ ] Code is written and works correctly
- [ ] Changes are covered by tests
- [ ] Any new configurable parameters are documented in
`rel/overlay/etc/default.ini`
- [ ] Documentation changes were made in the `src/docs` folder
- [ ] Documentation changes were backported (separated PR) to affected
branches
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]