James Phillips
6bf55d16a2
Relaxes Autopilot promotion logic. ( #3623 )
...
* Relaxes Autopilot promotion logic.
When we defaulted the Raft protocol version to 3 in #3477 we made
the numPeers() routine more strict to only count voters (this is
more conservative and more correct). This had the side effect of
breaking rolling updates because it's at odds with the Autopilot
non-voter promotion logic.
That logic used to wait to only promote to maintain an odd quorum
of servers. During a rolling update (add one new server, wait, and
then kill an old server) the dead server cleanup would still count
the old server as a peer, which is conservative and the right thing
to do, and no longer count the non-voter. This would wait to promote,
so you could get into a stalemate. It is safer to promote early than
remove early, so by promoting as soon as possible we have chosen
that as the solution here.
Fixes #3611
* Gets rid of unnecessary extra not-a-voter check.
2017-10-31 15:16:56 -05:00
Frank Schroeder
c72e6bdb37
docker: fix failing test
2017-10-31 09:26:34 +01:00
Frank Schroeder
7c0e5036a8
docker: render errors with %v since they can be nil
2017-10-31 09:19:20 +01:00
Kyle Havlovitz
a1d14019dd
Add tests around coordinate update endpoint
2017-10-26 20:12:54 -07:00
Kyle Havlovitz
2392545adc
Merge branch 'coordinate-node-endpoint' of github.com:hashicorp/consul into esm-changes
2017-10-26 19:20:24 -07:00
Kyle Havlovitz
5589eadcf5
Added Coordinate.Node rpc endpoint and client api method
2017-10-26 19:16:40 -07:00
Frank Schroeder
ca9aac746f
agent: add /v1/coordianate/node/:node endpoint
...
This patch adds a /v1/coordinate/node/:node endpoint to get the network
coordinates for a single node in the network.
Since Consul Enterprise supports network segments it is still possible
to receive mutiple entries for a single node - one per segment.
2017-10-26 14:24:42 +02:00
Frank Schroeder
b4d8c26194
docker: add comment about "connection reset by peer" error
2017-10-26 12:14:19 +02:00
Frank Schroeder
164ec3ec39
docker: stop previous check on replace
2017-10-26 12:03:07 +02:00
Frank Schroeder
e774b46f82
docker: close idle connections on stop
2017-10-26 12:02:39 +02:00
Frank Schroeder
94726ef105
docker: do not alloc a tty since this is not interactive
2017-10-26 11:56:54 +02:00
Frank Schroeder
a1b47d99c1
docker: make sure to log the error when we fall through
2017-10-26 11:56:36 +02:00
Frank Schroeder
51a18c2557
docker: ignore "connection reset by peer"
...
The Docker agent closes the connection during read after we have
read the body. This causes a "connection reset by peer" even though
the command was successful.
We ignore that error here since we got the correct status code
and a response body.
2017-10-26 11:56:08 +02:00
Kyle Havlovitz
ce4e8c46fa
Add deregister critical service field and refactor duration parsing
2017-10-25 19:17:41 -07:00
Kyle Havlovitz
291455f475
Added coordinate update http endpoint
2017-10-25 19:37:30 +02:00
Kyle Havlovitz
d56936e27a
Added remaining HTTP health check fields to structs
2017-10-25 19:37:30 +02:00
Kyle Havlovitz
a7c42a6c2a
Expose SkipNodeUpdate field and some health check info in the http api
2017-10-25 19:37:30 +02:00
Frank Schroeder
d14adc6b4d
fix go vet issue
2017-10-25 19:30:35 +02:00
Frank Schroeder
96fdbd00a6
replace custom unique id with a UUID
2017-10-25 19:30:35 +02:00
Frank Schroeder
8f145559d8
Decouple the code that executes checks from the agent
2017-10-25 11:18:07 +02:00
Frank Schroeder
1cb8b0ffe3
local state: fix go vet issue
2017-10-23 10:56:05 +02:00
Frank Schroeder
7335c34c32
local state: remove stale comment
2017-10-23 10:56:05 +02:00
Frank Schroeder
3d547e30c7
local state: make test more robust
2017-10-23 10:56:05 +02:00
Frank Schroeder
52e73301f6
local state: clone check to avoid side effect
2017-10-23 10:56:05 +02:00
Frank Schroeder
6bc9d66192
local state: use synchronized access to internal maps
2017-10-23 10:56:05 +02:00
Frank Schroeder
cc0499da3d
ae: do not trigger on Resume while holding the lock
2017-10-23 10:56:05 +02:00
Frank Schroeder
92f136de12
ae: add remaining test cases
2017-10-23 10:56:05 +02:00
Frank Schroeder
622ace2829
ae: refactor StateSyncer to state machine for better testing
2017-10-23 10:56:05 +02:00
Frank Schroeder
1212598ae2
ae: add test that we run a full before a partial sync
2017-10-23 10:56:05 +02:00
Frank Schroeder
4431e222fe
ae: make control flow more explicit
2017-10-23 10:56:05 +02:00
Frank Schroeder
3231385089
ae: fix typo in constructor name
2017-10-23 10:56:05 +02:00
Frank Schroeder
51daa96dfe
ae: add test for resume triggering SyncChanges
2017-10-23 10:56:05 +02:00
Frank Schroeder
92088d21e8
ae: add test for ifNotPausedRun
2017-10-23 10:56:05 +02:00
Frank Schroeder
11e172d1e9
ae: make stagger function pluggable for testing
2017-10-23 10:56:05 +02:00
Frank Schroeder
e2452efed8
ae: restore previous pause/resume behavior
2017-10-23 10:56:04 +02:00
Frank Schroeder
aba072bd1d
ae: ensure that syncs are blocked when paused
2017-10-23 10:56:04 +02:00
Frank Schroeder
58d52ac580
local state: rename Add{Check,Service}State to Set{Check,Service}State
2017-10-23 10:56:04 +02:00
Frank Schroeder
e144f51b29
local state: move Metadata methods together
2017-10-23 10:56:04 +02:00
Frank Schroeder
4f9e05f634
local state: update documentation of updateSyncState
2017-10-23 10:56:04 +02:00
Frank Schroeder
41c7b0927e
local state: update comments
2017-10-23 10:56:04 +02:00
Frank Schroeder
de57b16d99
local state: address review comments
...
* move non-blocking notification mechanism into ae.Trigger
* move Pause/Resume into separate type
2017-10-23 10:56:04 +02:00
Frank Schroeder
5c77c59501
local state: refactor TestAgentAntiEntropy_EnableTagOverride
...
Make intent clearer by being more explicit and adding some comments.
Use verify.Values to compare service entries.
2017-10-23 10:56:04 +02:00
Frank Schroeder
524981f367
local state: fix TestAgentAntiEntropy_EnableTagOverride
...
The test had a race condition where it relied on the first service to be
synced to the remote catalog which sometimes failed.
2017-10-23 10:56:04 +02:00
Frank Schroeder
1181aaee6a
local state: rename tests
2017-10-23 10:56:04 +02:00
Frank Schroeder
1602ac56b5
local state: drop retry loops from tests
...
Since the tests are now using synchronous calls for state syncing
we no longer need to use retry loops to wait for the changes to
propagate.
2017-10-23 10:56:04 +02:00
Frank Schroeder
7e3adc4549
agent: skip non-sensical TestCatalogRegister
...
It is not clear what this test is supposed to verify.
2017-10-23 10:56:04 +02:00
Frank Schroeder
71c74e62c7
local state: fix anti-entropy state tests
...
The anti-entropy tests relied on the side-effect of the StartSync()
method to perform a full sync instead of a partial sync. This lead to
multiple anti-entropy go routines being started unnecessary retry loops.
This change changes the behavior to perform synchronous full syncs when
necessary removing the need for all of the time.Sleep and most of the
retry loops.
2017-10-23 10:56:04 +02:00
Frank Schroeder
37b95ef98e
local state: fix test with updated error message
2017-10-23 10:56:04 +02:00
Frank Schroeder
d2cc0e6e8a
local state: fix failing tests
2017-10-23 10:56:03 +02:00
Frank Schroeder
b803bf3091
local state: tests compile
2017-10-23 10:56:03 +02:00