Commit Graph

1195 Commits

Author SHA1 Message Date
Kyle Havlovitz b20fd222f6
Add raft version 2/3 compatibility 2017-02-22 12:53:32 -08:00
Kyle Havlovitz 985d232522
Add configurable cleanup of dead servers when a new server joins 2017-02-17 10:49:16 -08:00
Sean Chittenden b94aac3a2c
Round the node lookup prefix down to the nearest modulo two size before
performing the lookup.

Hat tip: @dadgar
2017-02-02 12:13:58 -08:00
Sean Chittenden fe49c0a0ab
Reduce the size of the UUID Lookup Length restriction from `8` to `2`.
I'm torn on this.  It's useful from a UX perspective for an operator to
be able to type in something that's short.  At the same time, by
enforcing an `8` character length, we reduced the probability of a user
depending on the behavior and having it suddenly stop working in the
future when a duplicate prefix is injected into the environment.
2017-02-02 12:12:18 -08:00
Kyle Havlovitz 5b8049075e Merge pull request #2704 from hashicorp/f-relay-query-responses
Add relay-factor arg to keyring operations
2017-02-02 12:15:19 -05:00
Kyle Havlovitz 5d888f5303
Added -relay-factor param to keyring operations 2017-02-01 21:53:29 -05:00
James Phillips 15e2e64c00
Adds a test for node UUID or name lookups. 2017-02-01 16:41:44 -08:00
Sean Chittenden b764606844 Merge pull request #2702 from hashicorp/f-dns-nodeid
DNS lookup by Consul node ID
2017-02-01 16:23:18 -08:00
Sean Chittenden c16f33402a
Treat a uuid prefix lookup error as a soft error, as if a node name
lookup returned nil.

Add a TODO to note where a future point of logging should occur once a
logger is present and a few additional comments to explain the program
flow.
2017-02-01 16:09:25 -08:00
Sean Chittenden 62527c1698
Treat a uuid prefix lookup error as a soft error, as if a node name lookup returned nil.
Add a TODO to note where a future point of logging should occur once a
logger is present.
2017-02-01 15:51:25 -08:00
Sean Chittenden 295ca817f3
Run a test of `NodeServices()` with a NodeID as an argument. 2017-02-01 15:41:10 -08:00
Sean Chittenden 854f2b2bfc
Whoops. Return an empty set in the event that there are multiple matches. 2017-02-01 15:18:00 -08:00
Sean Chittenden e86cefe640
Rename `nodeName` to `nodeNameOrID`. 2017-02-01 14:59:24 -08:00
Sean Chittenden 13fb395010
Toggle `AllowMissing` to false to accommodate old clients without Node IDs. 2017-02-01 14:58:34 -08:00
Sean Chittenden f3f3f73e6d
Enable looking up consul nodes by their node ID.
Assuming the following output from a consul agent:

```
==> Consul agent running!
           Version: 'v0.7.3-43-gc5e140c-dev (c5e140c+CHANGES)'
           Node ID: '40e4a748-2192-161a-0510-9bf59fe950b5'
         Node name: 'myhost'
```

it is now possible to lookup nodes by their Node Name or Node ID, or a
prefix match of the Node ID, with the following caveats re: the prefix
match:

1) first eight digits of the Node ID are a required minimum (eight was
   chosen as an arbitrary number)
2) the length of the Node ID must be an even number or no result will be
   returned.

```
% dig @127.0.0.1 -p 8600 myhost.node.dc1.consul.
myhost.node.dc1.consul.	0	IN	A	127.0.0.1
% dig @127.0.0.1 -p 8600 40e4a748-2192-161a-0510-9bf59fe950b5.node.dc1.consul.
40e4a748-2192-161a-0510-9bf59fe950b5.node.dc1.consul. 0	IN A 127.0.0.1
% dig @127.0.0.1 -p 8600 40e4a748.node.dc1.consul.
40e4a748.node.dc1.consul. 0	IN	A	127.0.0.1
% dig @127.0.0.1 -p 8600 40e4a74821.node.dc1.consul.
40e4a74821.node.dc1.consul. 0	IN	A	127.0.0.1
% dig @127.0.0.1 -p 8600 40e4a748-21.node.dc1.consul.
40e4a748-21.node.dc1.consul. 0	IN	A	127.0.0.1
```
2017-02-01 14:46:25 -08:00
Kyle Havlovitz 07ba3ddb6e
Add TLSMinVersion to config options 2017-02-01 16:20:33 -05:00
Sean Chittenden c5e140c79d
Small premature optimization in `isUUID()`.
If the length isn't `36`, return `false` immediately before firing up
the regexp engine.
2017-02-01 11:00:06 -08:00
James Phillips f11817dcdf
Tweaks leader test now that we have new wait timing. 2017-01-25 22:12:22 -08:00
James Phillips 0c93ff1d13
Keeps the old state store state if a restore fails. 2017-01-25 19:42:34 -08:00
James Phillips c370d4ff29
Bails out of blocking queries when a state restore occurs. 2017-01-25 19:00:32 -08:00
James Phillips b787aa17ab
Tweaks a few comments. 2017-01-25 09:58:23 -08:00
James Phillips 75f2aa8588
Pass state store pointer into the blocking query work function.
Previously the blocking functions all closed over the state store from
their first query, with would not have worked properly when a restore
occurred. This makes sure they get a frest state store pointer each time,
and that pointer is synchronized with the abandon watch.
2017-01-25 09:58:23 -08:00
James Phillips d97c3c6c18
Guts all the old blocking query code. 2017-01-25 09:58:23 -08:00
James Phillips 7da2f513dc
Cuts KVS endpoints over to new fine-grained watch plumbing. 2017-01-25 09:58:22 -08:00
James Phillips 68e90d0f24
Adds a facility to notify when restores occur. 2017-01-25 09:58:22 -08:00
James Phillips 1d39ddbd4b
Adds fine-grained watches to session endpoints. 2017-01-25 09:58:22 -08:00
James Phillips 8b7977ccb3
Adds fine-grained watches to prepared query endpoints. 2017-01-25 09:58:22 -08:00
James Phillips dfcffe097c
Adds fine-grained watches to internal endpoints. 2017-01-25 09:58:22 -08:00
James Phillips 3675e5ceba
Adds fine-grained watches to coordinate endpoints. 2017-01-25 09:58:22 -08:00
James Phillips ec90404df0
Adds fine-grained watch support to ACL endpoints. 2017-01-25 09:58:22 -08:00
James Phillips dcb55c766b
Adds fine-grained watches to health endpoints. 2017-01-25 09:58:22 -08:00
James Phillips e4b88324b3
Fixes a race condition when updating the state store during a snapshot restore. 2017-01-25 09:58:22 -08:00
James Phillips b7b42d718a
Adds fine-grained watches to catalog endpoints. 2017-01-25 09:58:22 -08:00
James Phillips f2d9da270d
Adds diff check for node and service parts of register requests.
We always did an update before which caused excessive watch churn, even
with our new fine-grained queries. This does a diff any only updates the
node and service records if something actually changed.
2017-01-25 09:58:22 -08:00
James Phillips fefed7c803
Don't do any watch tracking for non-blocking queries. 2017-01-25 09:58:22 -08:00
James Phillips 05735e39a5
Removes some incorrect comments.
We can't actually return a fine-grained index from these tables unless
support is added for tombstones. Otherwise, the index could slip backwards
as things are deleted.
2017-01-25 09:58:22 -08:00
James Phillips b21625a6af
Adds new variant of blocking query wrapper with WatchSet support. 2017-01-25 09:58:22 -08:00
Kyle Havlovitz bbfd25b530
Fix test import 2017-01-23 21:34:01 -05:00
Kyle Havlovitz a55968f009
Merge branch 'master' into f-prepared-query-nodemeta 2017-01-23 20:17:48 -05:00
Kyle Havlovitz 3f3d7f9891
Add tests for node meta in prepared queries and update docs 2017-01-23 19:17:30 -05:00
James Phillips acbc2289a3 Merge pull request #2661 from hashicorp/f-node-id
Adds basic support for node IDs.
2017-01-18 16:02:38 -08:00
James Phillips bcf770f811
Uses clean replies each time so they are safe to receive map changes. 2017-01-18 15:40:19 -08:00
James Phillips 32be684fdf
Fixes a startup ordering issue between Raft and Serf.
This fixes #2663 and fixes #1899. It's not super related to this PR,
but the startup time changes that this PR brings made this a lot worse
so I was able to track it down.
2017-01-18 15:06:15 -08:00
James Phillips 6ca0173907
Adds catalog support for node IDs. 2017-01-18 14:26:42 -08:00
Kyle Havlovitz 4e8c0fca63
First pass at adding node meta filter to prepared queries 2017-01-18 16:23:33 -05:00
James Phillips bd605e330c
Adds basic support for node IDs. 2017-01-17 22:47:59 -08:00
Kyle Havlovitz f48f105949
Minor formatting tweaks as a follow-up to #2654 2017-01-17 19:20:29 -05:00
Kyle Havlovitz 9e696220a8
Add support for multiple metadata filters to remaining endpoints
Enabled multiple meta filters for /v1/catalog/nodes and /v1/catalog/services
2017-01-13 20:49:13 -05:00
Kyle Havlovitz 5acd69b4fc
Add node metadata filtering to remaining health/catalog endpoints 2017-01-13 20:08:43 -05:00
James Phillips 1330499707
Breaks up the state store into several files. 2017-01-13 11:47:16 -08:00