Commit Graph

1818 Commits

Author SHA1 Message Date
Atin Malaviya b623af776b Consul Session TTLs
The design of the session TTLs is based on the Google Chubby approach
(http://research.google.com/archive/chubby-osdi06.pdf). The Session
struct has an additional TTL field now. This attaches an implicit
heartbeat based failure detector. Tracking of heartbeats is done by
the current leader and not persisted via the Raft log. The implication
of this is during a leader failover, we do not retain the last
heartbeat times.

Similar to Chubby, the TTL represents a lower-bound. Consul promises
not to terminate a session before the TTL has expired, but is allowed
to extend the expiration past it. This enables us to reset the TTL on
a leader failover. The TTL is also extended when the client does a
heartbeat. Like Chubby, this means a TTL is extended on creation,
heartbeat or failover.

Additionally, because we must account for time requests are in transit
and the relative rates of clocks on the clients and servers, Consul
will take the conservative approach of internally multiplying the TTL
by 2x. This helps to compensate for network latency and clock skew
without violating the contract.

Reference: https://docs.google.com/document/d/1Y5-pahLkUaA7Kz4SBU_mehKiyt9yaaUGcBTMZR7lToY/edit?usp=sharing
2014-12-07 12:38:22 -05:00
Marin 781692e3a8 ui: confirm dialog only when deleting key directories #521 2014-12-06 12:00:51 -08:00
Ali Abbas 154c4e93e4 since dns.TXT is an external dependency, it is safer to add keys to the fields to avoid some potential ordering issues if changes in this field occur with upstream 2014-12-06 13:13:35 +01:00
Ali Abbas a542df954f cleanup and simplify 2014-12-06 13:08:35 +01:00
Ali Abbas 0117529781 remove control flow on errExit by switching from bool to int 2014-12-06 12:50:38 +01:00
Ali Abbas 40979b1159 * use defer to avoid tracking lock
* simplify control flow
2014-12-06 12:32:18 +01:00
Armon Dadgar 165e282e1c Merge pull request #518 from larsks/master
updates to leader election documentation
2014-12-05 18:59:39 -08:00
Armon Dadgar 66dc7752e0 Merge pull request #516 from mtchavez/tests/fix-failing
Tests/fix failing
2014-12-05 18:50:30 -08:00
Chavez 72904e39bd Separate cover target for tests 2014-12-05 18:47:23 -08:00
Marin bed14bb96f ui: ask for confirmation before deleting keys #520 2014-12-05 17:14:11 -08:00
Lars Kellogg-Stedman 52df94e560 updates to leader election documentation
Clarify the steps involved in the leader election process.

- provide examples of creating a session
- provide links to appropriate documentation
2014-12-05 14:28:21 -05:00
Chavez 5f4281f98f consul: Server leave test fix 2014-12-05 11:22:54 -08:00
Chavez 7c1aad7b1d agent: agent test fixes 2014-12-05 10:36:44 -08:00
Chavez c6b3cae106 consul: Fix failing globalRPC test 2014-12-05 10:36:37 -08:00
Chavez 904b14dc93 Fix typo 2014-12-04 23:11:47 -08:00
Chavez 12966dc9f7 Vagrant updates
* Add go tools to provision script
* Sync project folder
* Fix ruby styling issues
* Add --cover flag to test commands
2014-12-04 21:24:05 -08:00
Armon Dadgar b4021621b5 Merge pull request #514 from vlajos/typofixes-vlajos-20141204
typofixes - https://github.com/vlajos/misspell_fixer
2014-12-04 15:41:16 -08:00
Veres Lajos 850d5bdc32 typofixes - https://github.com/vlajos/misspell_fixer 2014-12-04 23:25:06 +00:00
Ryan Uber a6608c07ae Merge pull request #511 from catsby/exec-doc-update
Small doc update for exec command
2014-12-04 00:40:39 -08:00
Clint Shryock 693fa207c8 Small doc update for exec command
the documentation for -tag says it must be used with -service, but
example used is -server, which doesn't work.

This changes -server to -service.
2014-12-03 22:46:26 -06:00
Armon Dadgar b10159a87b agent: Handle service ACLs when doing anti-entropy 2014-12-01 11:43:01 -08:00
Armon Dadgar c0b39843e0 Merge pull request #506 from hashicorp/f-service-acl
Service ACL support
2014-11-30 21:11:36 -07:00
Armon Dadgar 402d580863 consul: Check that ACL also allows registration 2014-11-30 21:10:42 -07:00
Armon Dadgar d74f79b3fa consul: Enforce service registration ACLs 2014-11-30 21:05:15 -07:00
Armon Dadgar 7b8faf4cb3 acl: Expose service policy checks 2014-11-30 20:33:46 -07:00
Armon Dadgar b9810f774c acl: Support for service policies 2014-11-30 20:18:16 -07:00
Armon Dadgar 376f9694f4 website: Update ACL docs 2014-11-30 20:12:44 -07:00
Ryan Uber 42bad4af80 agent: fixup all check definitions from json config 2014-11-30 18:27:37 -08:00
Ryan Uber 9e52588cec agent: persist CheckType with health checks 2014-11-29 12:54:37 -08:00
Ryan Uber 4f14ba6326 agent: allow config reload to modify checks/services persistence
This change consolidates loading services and checks from both config
and persisted state into methods on the agent. As part of this, we
introduce optional persistence when calling RemoveCheck/RemoveService.

Fixes a bug where config reloads would kill persisted services/checks.
Also fixes an edge case:

1. A service or check is registered via the HTTP API
2. A new service or check definition with the same ID is added to config
3. Config is reloaded

The desired behavior (which this implements) is:

1. All services and checks deregistered in memory
2. All services and checks in config are registered first
3. All persisted checks are restored using the same logic as the agent
   start sequence, which prioritizes config over persisted, and removes
   any persistence files if new config counterparts are present.
2014-11-26 12:46:42 -08:00
Armon Dadgar 795bcc57a5 Merge pull request #499 from alouche/fix_potential_race_condition_shutdown
Fix potential race condition on shutdown (pool.reap/server.handleConsulConn)
2014-11-26 11:39:33 -08:00
Seth Vargo 7a5b83bf24 Merge pull request #500 from d3xf/pr-minor-doc-fixes
Minor documentation fixes
2014-11-26 09:08:45 -05:00
Dan Frost bd5467c593 docs: agent/watches: minor fixes 2014-11-26 13:48:33 +00:00
Dan Frost bfd6c8aac0 docs: agent/checks: minor fixes 2014-11-26 13:42:53 +00:00
Dan Frost f0a2fa325a docs: agent/dns: minor fixes 2014-11-26 13:33:55 +00:00
Dan Frost e1a0845f5a docs: agent/basics: minor fixes 2014-11-26 13:15:41 +00:00
Dan Frost 261c69c4ff docs: internals/security: minor fixes 2014-11-26 13:05:33 +00:00
Dan Frost 548f1a07ad docs: internals/acl: minor fixes 2014-11-26 12:57:15 +00:00
Dan Frost 2ad884abee docs: internals/sessions: minor fixes 2014-11-26 12:49:53 +00:00
Dan Frost dbb365baca docs: internals/architecture: minor fixes 2014-11-26 12:31:38 +00:00
Dan Frost 7ff0acfb65 docs: compatibility: minor fixes 2014-11-26 12:09:36 +00:00
Dan Frost e18b3859f1 docs: intro/kv: minor fixes 2014-11-26 12:00:49 +00:00
Dan Frost a6420171e5 docs: intro/checks: minor fixes 2014-11-26 11:55:42 +00:00
Dan Frost 0b4e99dfe5 docs: intro/join: minor fixes 2014-11-26 11:49:39 +00:00
Dan Frost 2eca9b0182 docs: intro/services: minor fixes 2014-11-26 11:42:02 +00:00
Dan Frost 7d75e92104 docs: intro/agent: minor fixes 2014-11-26 11:37:28 +00:00
Ali Abbas 818fc22c9f * Fix race condition on read/write of shutdown bool variable of server and connection pool.
* In connection pool, there is no guarantee that .reap() cannot execute the same time as .Shutdown() is called. It also did not benefit to eval shutdown when a select is run on the shutdown channel.
* In server, same principle applies to handleConsulConn. Since we also have a shutdown channel, it makes more to use this than to loop on a bool variable.
2014-11-26 10:39:25 +01:00
Ryan Uber 58ba650cb0 website: Improve docs for reloading config. Fixes #407 2014-11-25 19:03:14 -08:00
Ryan Uber 1d016aadea Merge pull request #498 from alouche/fix_sprintf_unreachable_code
Fix sprintf formatting and cleanup unreachable code
2014-11-25 11:18:16 -08:00
Ali Abbas ecac719bb8 fix Sprintf formatting 2014-11-25 20:06:33 +01:00