Commit graph

15422 commits

Author SHA1 Message Date
Mahmood Ali c5f5a1fcb9 client: defensive against getting stale alloc updates
When fetching node alloc assignments, be defensive against a stale read before
killing local nodes allocs.

The bug is when both client and servers are restarting and the client requests
the node allocation for the node, it might get stale data as server hasn't
finished applying all the restored raft transaction to store.

Consequently, client would kill and destroy the alloc locally, just to fetch it
again moments later when server store is up to date.

The bug can be reproduced quite reliably with single node setup (configured with
persistence).  I suspect it's too edge-casey to occur in production cluster with
multiple servers, but we may need to examine leader failover scenarios more closely.

In this commit, we only remove and destroy allocs if the removal index is more
recent than the alloc index. This seems like a cheap resiliency fix we already
use for detecting alloc updates.

A more proper fix would be to ensure that a nomad server only serves
RPC calls when state store is fully restored or up to date in leadership
transition cases.
2019-06-29 04:17:35 -05:00
Preetha Appan 3345ce3ba4
Infer content type in alloc fs stat endpoint 2019-06-28 20:31:28 -05:00
Danielle Lancashire e1151f743b
appveyor: Run logmon tests 2019-06-28 16:01:41 +02:00
Danielle Lancashire 634ada671e
fifo: Require that fifos do not exist for create
Although this operation is safe on linux, it is not safe on Windows when
using the named pipe interface. To provide a ~reasonable common api
abstraction, here we switch to returning File exists errors on the unix
api.
2019-06-28 13:47:18 +02:00
Danielle Lancashire 0ff27cfc0f
vendor: Use dani fork of go-winio 2019-06-28 13:47:18 +02:00
Danielle Lancashire 514a2a6017
logmon: Refactor fifo access for windows safety
On unix platforms, it is safe to re-open fifo's for reading after the
first creation if the file is already a fifo, however this is not
possible on windows where this triggers a permissions error on the
socket path, as you cannot recreate it.

We can't transparently handle this in the CreateAndRead handle, because
the Access Is Denied error is too generic to reliably be an IO error.
Instead, we add an explict API for opening a reader to an existing FIFO,
and check to see if the fifo already exists inside the calling package
(e.g logmon)
2019-06-28 13:41:54 +02:00
Michael Lange 4884780b2a
Merge pull request #5902 from hashicorp/b-ui/allocation-magnifying-glass
UI: Account for the search icon within the is-compact modifier
2019-06-27 14:37:14 -07:00
Michael Lange aedeeadebd Account for the search icon within the is-compact modifer 2019-06-27 12:32:26 -07:00
Omar Khawaja b9f0407f17
make purge parameter lowercase (#5895) 2019-06-27 14:07:25 -04:00
Mahmood Ali 3d89ae0f1e task runner to avoid running task if terminal
This change fixes a bug where nomad would avoid running alloc tasks if
the alloc is client terminal but the server copy on the client isn't
marked as running.

Here, we fix the case by having task runner uses the
allocRunner.shouldRun() instead of only checking the server updated
alloc.

Here, we preserve much of the invariants such that `tr.Run()` is always
run, and don't change the overall alloc runner and task runner
lifecycles.

Fixes https://github.com/hashicorp/nomad/issues/5883
2019-06-27 11:27:34 +08:00
Preetha Appan f6fc5d40d1
one more drain test 2019-06-26 17:33:51 -05:00
Preetha Appan 67bf66efc6
remove now unneeded test 2019-06-26 16:59:23 -05:00
Preetha Appan 3484f18984
Fix more tests 2019-06-26 16:30:53 -05:00
Preetha Appan ff1b80dba6
Fix node drain test 2019-06-26 16:12:07 -05:00
Preetha Appan 23319e04d6
Restore accidentally deleted block 2019-06-26 13:59:14 -05:00
Danielle d6b8a0a290
Merge pull request #5889 from hashicorp/dani/b-task-restart
tr: Fetch Wait channel before killTask in restart
2019-06-26 16:18:08 +02:00
Danielle Lancashire b9ac184e1f
tr: Fetch Wait channel before killTask in restart
Currently, if killTask results in the termination of a process before
calling WaitTask, Restart() will incorrectly return a TaskNotFound
error when using the raw_exec driver on Windows.
2019-06-26 15:20:57 +02:00
Preetha Appan 66fa6a67ec
newline 2019-06-25 19:41:09 -05:00
Preetha Appan 10e7d6df6d
Remove compat code associated with many previous versions of nomad
This removes compat code for namespaces (0.7), Drain(0.8) and other
older features from releases older than Nomad 0.7
2019-06-25 19:05:25 -05:00
Nick Ethier 448b759578
Merge pull request #5875 from sarcasticadmin/update-example-config
Update website example config
2019-06-24 08:15:14 -04:00
Robert James Hernandez 16939aa8c3 Update website example config 2019-06-23 10:41:48 -07:00
Buck Doyle 4aae981699
Add ember-qunit-nice-errors (#5869)
This shows the entire assertion that’s failing. This is
especially useful in combination with page objects.

For an assertion like this:
assert.equal(PageLayout.flashMessages.length, 1)

The failure displayed normally is just “failed” with the
expected of 1 and the result of undefined. With this addon,
the expected and result remain the same, but “failed” is
replaced with the text of the assertion.

The typical way to address this is to supply the optional
final argument to the assertion function that customises the
failure message. That still works with this addon, but most
of the time it becomes unnecessary.
2019-06-21 14:12:28 -05:00
Chris Baker 7c016b89c2
Merge pull request #5865 from hashicorp/b-alloc-stop-missing-panic
alloc lifecycle: 404 when attempting to stop non-existent allocation
2019-06-21 06:09:51 -04:00
Chris Baker 59fac48d92 alloc lifecycle: 404 when attempting to stop non-existent allocation 2019-06-20 21:27:22 +00:00
Michael Lange 792d39ac93
Merge pull request #5828 from hashicorp/f-ui/ui-screenshots-script
UI Screenshots script
2019-06-19 17:39:01 -07:00
Michael Lange 9594fade9c Also move the make targets to the root 2019-06-19 17:20:13 -07:00
Michael Lange 539b1693c0 Moved the ui screenshots script from /website/scripts to /scripts
Having a node package in the website dir is incompatible with the way
middleman watches the filesystem.
2019-06-19 17:18:44 -07:00
Michael Lange af6daf34d2 Give the allTheThings scenario a better name 2019-06-19 17:18:43 -07:00
Michael Lange a7603747a0 Warn about the correct mirage scenario when starting the screenshots script 2019-06-19 17:18:42 -07:00
Michael Lange bf20c16710 Use local package.json instead of inherited one from buildkite/puppeteer container 2019-06-19 17:18:41 -07:00
Michael Lange 6201003f3f New Mirage scenario for puppeteer script to use 2019-06-19 17:18:40 -07:00
Michael Lange 22ce4894c7 A make target for running the screenshots script locally 2019-06-19 17:18:39 -07:00
Michael Lange afe64a44c9 A make target for running the screenshots script in a docker container 2019-06-19 17:18:38 -07:00
Michael Lange 2996fd951b A puppeteer based docker container for running the screenshots script without having to deal with headless chrome 2019-06-19 17:18:37 -07:00
Michael Lange 2d8caa9659 New script for automatically capturing UI screenshots to use for guides and docs 2019-06-19 17:18:36 -07:00
Omar Khawaja 4f357a91ac
[WIP] Add telemetry overview section (#5529)
* re-arrange telemetry docs and add overview with navigation

* update job and task status section

* fix navigation

* Update website/source/docs/telemetry/overview.html.md

Co-Authored-By: Chris Baker <cgbaker@hashicorp.com>

* Update website/source/docs/telemetry/overview.html.md

Co-Authored-By: Chris Baker <cgbaker@hashicorp.com>

* Update website/source/docs/telemetry/overview.html.md

Co-Authored-By: Chris Baker <cgbaker@hashicorp.com>

* Update website/source/docs/telemetry/metrics.html.md

Co-Authored-By: Chris Baker <cgbaker@hashicorp.com>

* Update website/source/docs/telemetry/metrics.html.md

Co-Authored-By: Chris Baker <cgbaker@hashicorp.com>

* fix formatting for nomad.plan.evaluate metric

* clarifications on collection interval and namespace labell

* fix typo

* Update website/source/docs/telemetry/overview.html.md

Co-Authored-By: Chris Baker <cgbaker@hashicorp.com>

* Update website/source/docs/telemetry/overview.html.md

Co-Authored-By: Chris Baker <cgbaker@hashicorp.com>

* Update website/source/docs/telemetry/overview.html.md

Co-Authored-By: Chris Baker <cgbaker@hashicorp.com>
2019-06-19 15:25:14 -04:00
Mahmood Ali 95f621559b Update 0.9.3 and 0.9.4 changelog formating
to be consistent with other entries
2019-06-19 14:17:28 -04:00
Mahmood Ali ab428eaa2a Changelog GH-5844 2019-06-19 14:16:11 -04:00
Buck Doyle a2b80bebe6
Update client list to combine statuses (#5789)
The draining, eligibility, and status fields now all show under a combined
state column. Draining takes precedence, then (in)eligibility; if neither of
those is true, the status displays.
2019-06-19 10:11:17 -07:00
Preetha 1dd300d02c
Merge pull request #5857 from hashicorp/missing-changelogs
Couple of changelog updates
2019-06-19 12:09:05 -05:00
Preetha Appan 23aed03592
Couple of changelog updates 2019-06-19 12:08:15 -05:00
Preetha 586e50d1a4
Merge pull request #5841 from hashicorp/f-raft-snapshot-metrics
Raft and state store indexes as metrics
2019-06-19 12:01:03 -05:00
Preetha Appan 539d12e583
Add links to godoc for raft related metrics 2019-06-19 11:59:05 -05:00
Preetha Appan dc0ac81609
Change interval of raft stats collection to 10s 2019-06-19 11:58:46 -05:00
Chris Baker d8da6870fb
Merge pull request #5850 from hashicorp/b-5345-prometheus-metric-label-conflict
metrics: upgraded prometheus http client
2019-06-19 12:50:24 -04:00
Chris Baker 0436f70975
Merge branch 'master' into b-5345-prometheus-metric-label-conflict 2019-06-19 12:50:03 -04:00
Chris Baker 8dadc50f4a
Update CHANGELOG.md 2019-06-19 12:49:12 -04:00
Mahmood Ali 4c3798c82a
Merge pull request #5844 from hashicorp/b-hcl-parse-unknown-vars
Upgrade hcl2 to validate arrays for unknown values
2019-06-19 10:44:21 -04:00
Omar Khawaja da4c801eb2
fixing typos in operator endpoint api docs (#5854) 2019-06-19 10:35:47 -04:00
Mahmood Ali 31d1e4a66c update changelog for GH-5726, GH-5811, and GH-5851 2019-06-18 21:59:49 -04:00