Commit graph

1305 commits

Author SHA1 Message Date
Frank Schroeder 0a7898f039
test: simplify tests that check for peers 2017-05-05 17:07:04 +02:00
Frank Schroeder 5c6be1cc7a
test: Fix badly formatted retry.Run tests 2017-05-05 17:07:03 +02:00
Frank Schroeder 17f6ecdd12
test: convert remaining WaitForResult tests 2017-05-05 17:07:03 +02:00
James Phillips 7007c89870
retry: Removes the description parameter. 2017-05-05 17:07:03 +02:00
James Phillips ffdfe2c201
test: Tweaks ACL replication tests to converge faster w/less spam. 2017-05-05 17:07:03 +02:00
Frank Schroeder 9435cadeee
test: Refactor WaitForResult tests with retry
Refactor tests that use testutil.WaitForResult to use retry.

Since this requires refactoring the test functions in general this patch
also shows the use of the github.com/pascaldekloe/goe/verify library
which provides a good mechanism for comparing nested data structures.
Instead of just converting the tests from testutil.WaitForResult to
retry the tests that performing a nested comparison of data structures
are converted to the verify library at the same time.
2017-05-05 17:07:02 +02:00
Frank Schroeder b1e97baacb
Fix imports 2017-05-05 17:07:00 +02:00
James Phillips d567a9b53d
Adds support for new-style peers.json recovery for newer Raft protocol versions. 2017-05-04 14:15:59 -07:00
James Phillips 9c3abd33c3
Adds timeout and waits for feedback when asking the leader loop to reassert.
This adds on to the fix in #3004 for issue #2980.
2017-05-04 11:52:22 -07:00
Frank Schroeder cff494e47d
Do not block on reassertLeader during shutdown 2017-05-04 16:48:54 +02:00
Frank Schroeder cea98ae5f4
Straighten control flow in leader.go 2017-05-04 16:17:02 +02:00
James Phillips f3c1f516b4
Kick the leader loop on the proper thread after a snapshot restore, and
only if leadership is already established.
2017-05-04 16:17:01 +02:00
James Phillips 953347a6fe
Runs revoke leadership actions only if we've established leadership. 2017-05-04 16:17:01 +02:00
Frank Schroeder f894a4cb7d Use bind address as source for outgoing connections (#2822)
This patch configures consul to use the bind address as the
source address for outgoing connections.

Fixes #2822
2017-05-04 01:41:47 +02:00
Frank Schroeder c772cecaab Do not modify config after creation II
Move code for finding the advertise address via a
template into consulConfig() so that the config
object is not modified after creation.
2017-05-04 01:41:47 +02:00
Frank Schroeder 6b96c9ff91 Do not modify config after creation
Make sure the RPCAdvertise address is always set
so that the configuration does not have to be modified
after creation.
2017-05-04 01:41:47 +02:00
Frank Schroeder 8aa969c966 Cleanup consul/config 2017-05-04 01:41:47 +02:00
Frank Schroeder 2bf668b658 api: Add ServiceTags to Health state endpoint (#153)
This patch adds the ServiceTags to the /v1/health/state/<state>
endpoint.

Fixes #153
2017-04-28 15:00:08 -07:00
James Phillips 9ead18dbbb
Gets rid of zero-value initializer. 2017-04-28 08:52:50 -07:00
James Phillips 77b803c12b
Removes panic repro test. 2017-04-27 17:08:06 -07:00
James Phillips e9606c225a
Embeds the mutex since it covers all fields. 2017-04-27 17:04:49 -07:00
James Phillips 3fa22aa42b
Fixes panic when timer fires as tombstone GC is being stopped. 2017-04-27 16:43:07 -07:00
James Phillips e3ac9d5c1b
Cleans up some bad unit test failure cases. 2017-04-27 16:41:42 -07:00
James Phillips 8db344248b
Cleans up comments. 2017-04-27 16:41:28 -07:00
Frank Schroeder 9a2063bf6f test: Speedup session renew tests 2017-04-27 10:34:30 -07:00
Frank Schroeder 8feb9e5423 test: Speedup TestClient_RPC_ConsulServerPing 2017-04-27 10:34:30 -07:00
Kyle Havlovitz 42cf797ad9 Add TLS cipher suite options and CA path support (#2963)
This patch adds options to configure the available
TLS cipher suites and adds support for a path
for multiple CA certificates.

Fixes #2959
2017-04-27 01:29:39 -07:00
Frank Schroeder 9e2332f6a1 golint: Fix existing comments
This needs more work.
2017-04-25 09:26:13 -07:00
Frank Schroeder 9de4555c0c golint: Untangle if blocks with return in else 2017-04-25 09:26:13 -07:00
Frank Schroeder f50d6871f9 golint: No stutter 2017-04-25 09:26:13 -07:00
Frank Schroeder 8c7bb7b65a golint: Rename fields and structs 2017-04-25 09:26:13 -07:00
Frank Schroeder f4a56d8a44 golint: Replace a += 1 with a++ 2017-04-25 09:26:13 -07:00
Frank Schroeder c7f367af56 golint: Consistent receiver name
Ensure the receiver name is consistent
2017-04-25 09:26:13 -07:00
Frank Schroeder 744ecc3234 golint: Use fmt.Errorf(...)
Replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...)

    gofmt -w -r 'errors.New(fmt.Sprintf(a, b)) -> fmt.Errorf(a, b)' *.go
2017-04-25 09:26:13 -07:00
Frank Schroeder ebdb73d8f2 golint: Drop the unused value from range
for i, _ := range foo -> for i := range foo
2017-04-25 09:26:13 -07:00
Frank Schröder 5f0a967507 Issue #2905: Add check-not-exists to TXN endpoint
This patch adds support for asserting that a given
key does not exist in the KV store.

Fixes #2905
2017-04-20 17:50:52 -07:00
Frank Schroeder 9f8f258d4d Remove duplicate constants
This patch removes duplicate internal copies of constants in the structs
package which are also defined in the api package. The api.KVOp type
with all its values for the TXN endpoint and the api.HealthXXX constants
are now used throughout the codebase.

This resulted in some circular dependencies in the testutil package
which have been resolved by copying code and constants and moving the
WaitForLeader function into a separate testrpc package.
2017-04-20 09:54:49 -07:00
Frank Schröder 892fa89399 Add datacenter to catalog node API (#2917)
This patch stores the datacenter of a node in memdb
and exposes it via the API in all places where a Node
structure is returned.

 * /catalog/nodes
 * /catalog/node/:node
 * /catalog/service/:service
 * /health/service/:service
 * /query/:uuid/execute
2017-04-18 05:02:24 -07:00
James Phillips 002c70c4d4
Adds guard in session ACL check in case session is not found.
Fixes #2624.
2017-04-13 15:03:17 -07:00
James Phillips 6055a7c0bd
Switches to reliable Raft leader notifications.
This fixes #2896 by switching to the `notifyCh` instead of the `leaderCh`,
so we get all up/down events from Raft regarding leadership. We also wait
for the old leader loop to shut down before we ever consider starting a
new one, which keeps that single-threaded and fixes the panic in that issue.
2017-04-13 14:17:32 -07:00
Kyle Havlovitz 4584d4f4e7
Add nil check to operator autopilot endpoint 2017-04-13 10:43:07 -07:00
Kyle Havlovitz 31a249a42e
Add formatting to autopilot init messages 2017-04-12 18:39:03 -07:00
Kyle Havlovitz 0924d5a2de
Reorganize version check logic for autopilot 2017-04-12 17:09:57 -07:00
Kyle Havlovitz 22620d5e73
Wait to initialize autopilot until all servers are >= 0.8.0 2017-04-12 16:05:13 -07:00
James Phillips 5b35ee3866
Tweaks error handling case to not panic further down. 2017-04-12 10:02:42 -07:00
Wim 7c8f25c36e Fix ipv6 join failure 2017-04-06 23:27:39 +02:00
Kyle Havlovitz 4743895f40
Prefix autopilot log messages with 'autopilot' 2017-04-04 17:21:49 -07:00
Kyle Havlovitz a7fca8d6a7
Use voter count instead of server count for required quorum 2017-04-04 15:42:17 -07:00
James Phillips 76fdd5f392
Moves operator sub-functions into their own files. 2017-03-30 12:35:50 -07:00
Kyle Havlovitz 074b8576a5 Merge pull request #2847 from hashicorp/remove-peer-by-id
Add CLI/API endpoints for removing peer by ID
2017-03-30 10:13:56 -07:00