Commit Graph

6733 Commits

Author SHA1 Message Date
James Phillips aaf6b17a4d
Updates the change log. 2017-10-11 07:45:42 -07:00
James Bardin fea32fb7d7 retry locks on network errors (#3553)
* retry locks on network errors

When communicating with a local agent and watching a lock, a dropped
connection between the agent and server will show up as a server error
and immediately be retried. However if the client is connected to a
remote server, a dropped connection immediately aborts the lock.

* Updates comment about it being unsafe for writes.
2017-10-11 07:42:10 -07:00
Artiom Diomin 2e229617ce Fix example code formatting in godoc 2017-10-11 14:52:22 +02:00
Frank Schroeder 6780964eb8
config: remove redundant code 2017-10-11 10:16:21 +02:00
Frank Schroeder 0faff32c73
config: fix check for segment.port <= 0 and add test 2017-10-11 10:15:55 +02:00
James Phillips 16eb2ef014
Adds check to make sure port is given so we avoid a nil bind address. 2017-10-10 18:11:21 -07:00
James Phillips e6c50f4a71
Removes obsolete segment stub. 2017-10-10 17:21:32 -07:00
Frank Schröder 94f58199b1 agent: add option to discard health output (#3562)
* agent: add option to discard health output

In high volatile environments consul will have checks with "noisy"
output which changes every time even though the status does not change.
Since the output is stored in the raft log every health check update
unblocks a blocking call on health checks since the raft index has
changed even though the status of the health checks may not have changed
at all. By discarding the output of the health checks the users can
choose a different tradeoff. Less visibility on why a check failed in
exchange for a reduced change rate on the raft log.

* agent: discard output also when adding a check

* agent: add test for discard check output

* agent: update docs

* go vet

* Adds discard_check_output to reloadable config table.

* Updates the change log.
2017-10-10 17:04:52 -07:00
preetapan 77c972f594 Fixes agent error handling when check definition is invalid. Distingu… (#3560)
* Fixes agent error handling when check definition is invalid. Distinguishes between empty checks vs invalid checks

* Made CheckTypes return Checks from service definition struct rather than a new copy, and other changes from code review. This also errors when json payload contains empty structs

* Simplify and improve validate method, and make sure that CheckTypes always returns a new copy of validated check definitions

* Tweaks some small style things and error messages.

* Updates the change log.
2017-10-10 16:54:06 -07:00
Frank Schröder 759ef8a1d4 config: add generic method to translate between CamelCase and snake_case (#3557)
* doc: document discrepancy between id and CheckID

* doc: document enable_tag_override change

* config: add TranslateKeys helper

TranslateKeys makes it easier to map between different representations
of internal structures. It allows to recursively map alias keys to
canonical keys in structured maps.

* config: use TranslateKeys for config file

This also adds support for 'enabletagoverride' and removes
the need for a separate CheckID alias field.

* config: remove dead code

* agent: use TranslateKeys for FixupCheckType

* agent: translate enable_tag_override during service registration

* doc: add '.hcl' as valid extension

* config: map ScriptArgs to args

* config: add comment for TranslateKeys
2017-10-10 16:40:59 -07:00
James Phillips d3cebace7c
Updates documentation to s/script/args/ in API docs. 2017-10-10 16:37:08 -07:00
James Phillips f71eabdd0f
Updates the change log. 2017-10-10 15:24:10 -07:00
James Phillips bb12368eac Makes RPC handling more robust when rolling servers. (#3561)
* Adds client-side retry for no leader errors.

This paves over the case where the client was connected to the leader
when it loses leadership.

* Adds a configurable server RPC drain time and a fail-fast path for RPCs.

When a server leaves it gets removed from the Raft configuration, so it will
never know who the new leader server ends up being. Without this we'd be
doomed to wait out the RPC hold timeout and then fail. This makes things fail
a little quicker while a sever is draining, and since we added a client retry
AND since the server doing this has already shut down and left the Serf LAN,
clients should retry against some other server.

* Makes the RPC hold timeout configurable.

* Reorders struct members.

* Sets the RPC hold timeout default for test servers.

* Bumps the leave drain time up to 5 seconds.

* Robustifies retries with a simpler client-side RPC hold.

* Reverts untended delete.
2017-10-10 15:19:50 -07:00
James Phillips d8a1ec70f8 Update compatibility.html.md 2017-10-09 14:18:37 -07:00
James Phillips 486e1a277e Update compatibility.html.md 2017-10-09 14:18:23 -07:00
Radek Simko 0075421b1a docs: agent/options gcp's project_name is optional
Per https://github.com/hashicorp/go-discover/blob/master/provider/gce/gce_discover.go#L53-L61
2017-10-08 13:08:50 +02:00
Preetha Appan e7dc345cfa Fix unit test after dns library upgrade to account for correct data length 2017-10-06 17:40:17 -05:00
James Phillips 5f5e7529df Update raft.html.md 2017-10-06 14:38:21 -07:00
James Phillips 8a52684466
Updates the change log. 2017-10-06 14:17:21 -07:00
Preetha Appan 25caa39615 Updating CHANGELOG.md 2017-10-06 16:10:35 -05:00
preetapan 3703b05535 Merge pull request #3412 from hashicorp/jbs-autocomplete
Autocomplete support via @brianshumate
2017-10-06 15:46:26 -05:00
Preetha Appan 194b09a86b Update documentation with subcommand example 2017-10-06 15:23:43 -05:00
Preetha Appan 84ee8b8aff Autocomplete support 2017-10-06 15:05:45 -05:00
preetapan fd51793a48 Merge pull request #3548 from hashicorp/go_retryablehttp_update
Update go-retryablehttp
2017-10-06 13:44:26 -05:00
Preetha Appan 4fef528054 Update go-retryablehttp 2017-10-06 13:42:11 -05:00
James Phillips 305578faa7
Updates the change log. 2017-10-06 11:36:03 -07:00
preetapan 285dbe2d76 Vendor update miekg/dns to pick up bugfixes and features (#3547) 2017-10-06 11:34:41 -07:00
James Phillips 467f74586f
Adds a basic Linux Vagrant setup, stolen from Nomad. 2017-10-06 08:10:12 -07:00
James Phillips ea19a6eeeb
Updates the change log. 2017-10-06 07:57:22 -07:00
James Phillips 4dab70cb93 Fixes handling of stop channel and failed barrier attempts. (#3546)
* Fixes handling of stop channel and failed barrier attempts.

There were two issues here. First, we needed to not exit when there
was a timeout trying to write the barrier, because Raft might not
step down, so we'd be left as the leader but having run all the step
down actions.

Second, we didn't close over the stopCh correctly, so it was possible
to nil that out and have the leaderLoop never exit. We close over it
properly AND sequence the nil-ing of it AFTER the leaderLoop exits for
good measure, so the code is more robust.

Fixes #3545

* Cleans up based on code review feedback.

* Tweaks comments.

* Renames variables and removes comments.
2017-10-06 07:54:49 -07:00
James Phillips 8e19eb32fb
Updates the change log. 2017-10-05 09:30:56 -07:00
Frank Schroeder 7bee8e644d
command: show full help text on usage 2017-10-05 18:17:54 +02:00
Frank Schroeder 9d81676f22
Update CHANGELOG.md 2017-10-05 18:14:26 +02:00
Frank Schroeder bb13277ca1 command: do not merge flags in-place 2017-10-05 18:08:35 +02:00
Frank Schroeder e769cd22f6 command: simplify duplicate code 2017-10-05 18:08:35 +02:00
Frank Schroeder a364555121 command: drop hidden flags from base command 2017-10-05 18:08:35 +02:00
Frank Schroeder bc78fa576a command: drop unused hidden flags for 'validate' 2017-10-05 18:08:35 +02:00
Frank Schroeder 497d2702bf
command: drop legacy 'operator raft' tests 2017-10-05 17:56:16 +02:00
Frank Schroeder 4d604c5138 command: simplify 'operator raft'
The cli library can handle subcommands. Therefore, most of the code is
no longer necessary.
2017-10-05 17:40:57 +02:00
Frank Schroeder 3a7fb35fb0 command: don't show confusing error on usage output 2017-10-05 17:29:45 +02:00
Frank Schroeder 59b84fcda3 command: backport patch for mitchellh/cli help flag handling (#3536)
This patch backports a fix which will show the correct usage screen for
command line flags.

This is considered a temporary fix until the code has been refactored.
Newer versions of the cli library require that the flag set is populated
when Help() is called or that it is populated within Help() itself.

Fixes #3536
2017-10-05 17:29:45 +02:00
Frank Schroeder ce0d03c46a command: drop deprecated 'configtest' command
'configtest' has been replaced with 'validate'
2017-10-05 17:22:34 +02:00
Victor Boivie 8e361beb7a Minor typo (boostrap) 2017-10-05 16:28:48 +02:00
James Phillips edf7a162f6
Release v1.0.0-beta2 2017-10-04 23:07:24 -07:00
James Phillips 818a2de385
Puts the tree in 1.0.0-beta2 release mode. 2017-10-04 23:00:06 -07:00
James Phillips 732c27201e
Updates the change log. 2017-10-04 22:59:22 -07:00
James Phillips c4f34337c1 Updates Go version to 1.9.1. (#3537) 2017-10-04 22:58:13 -07:00
James Phillips 3bc6df5f0e
Adds script warning and fixes Docker args recognition. 2017-10-04 21:41:27 -07:00
James Phillips 3675b35235 Update CHANGELOG.md 2017-10-04 19:48:34 -07:00
James Phillips 658473dc5b
Updates the change log. 2017-10-04 19:47:44 -07:00