16302 Commits

Author SHA1 Message Date
Joe Betz
e81cae77a3
Merge pull request #12274 from ptabor/20200907-fix-cov-e2e-tests
tests/e2e,etcdctl,etcdmain: Fix go test --tags cov -v ./tests/e2e
2020-09-09 11:14:18 -07:00
Piotr Tabor
7c880e5263 etcdctl: Rename Start / StartWithErrors to MustStart 2020-09-09 19:32:50 +02:00
Joe Betz
10fa9614e1
Merge pull request #12271 from jingyih/add_watch_notify_interval_flag_in_testing
integration: add WatchProgressNotifyInterval in integration test
2020-09-09 08:56:48 -07:00
Piotr Tabor
c32180d772 tests/e2e,etcdctl,etcdmain: Fix go test --tags cov -v ./tests/e2e
This CL fixes:
  COVERDIR=./coverage PASSES="build_cov" && go test --tags cov -v ./tests/e2e
and is part of the effort to make:
  COVERDIR=coverage PASSES="build_cov cov" ./test
fully pass.

The args passed to ./bin/etcd_test and ./bin/etcdctl_test binaries were
mismatched. The protocol of passing the arguments using
environment variables has been replaces with proper passing of flags.

How the measurement of coverage by e2e tests works:
  1. COVERDIR=./coverage PASSES="build_cov" are generating
./bin/etcd_test and ./bin/etcdctl_test binaries.

  2. These binaries are tests (as coverage can be computed only for
tests) [see ./main_test.go ./etcdctl/main_test.go], but this tests are
running the main logic of the server and uppon termination (or SIGTERM
signal) are writting proper .coverprofile files in the $COVERDIR folder.
The binaries used to take arguments using env variables, but its not
needed any longer. The binaries can consume any command line arguments
that either test (so --test.fooo) or the original binary can consume.

 3.  The tests/e2e (when compiled with the --tags cov) are starting the
_test binaries instead of the original binaries, such that the coverage
is being collected.
2020-09-09 12:56:15 +02:00
jingyih
73817b53fd integration: add flag WatchProgressNotifyInterval in integration test 2020-09-07 08:32:54 -07:00
Ben Cox
c20cc05fc5
mvcc: Export a "Last DB compaction" timestamp metric (#12176)
This is to aid with debugging the effectiveness of systems that
manually take care of cluster compaction, and have greater visibity
into recent compactions.

It can be handy to alert on the exactly how long it was since a
compaction (and also to put on dashboards) had happened.

---

Tested using a test cluster, the final result looks like this:

```
	root@etcd-1:~# ETCDCTL_API=3 /tmp/test-etcd/etcdctl --endpoints=192.168.232.10:2379 compact 1012
	compacted revision 1012

	root@etcd-1:~# curl -s 192.168.232.10:2379/metrics | grep last
	# HELP etcd_debugging_mvcc_db_compaction_last The unix time since the last db compaction.  Resets to 0 on start.
	# TYPE etcd_debugging_mvcc_db_compaction_last gauge
	etcd_debugging_mvcc_db_compaction_last 1.595873939e+09
```
2020-08-26 16:27:10 -07:00
Gyuho Lee
facd0c9460
Merge pull request #12252 from spzala/changelogfileperm34and33
CHANGELOG: file perm updates in 3.4 and 3.3
2020-08-24 12:30:21 -07:00
Sahdev P. Zala
1c0d73d248 CHANGELOG: file perm updates in 3.4 and 3.3
Updates for https://github.com/etcd-io/etcd/pull/12250 and
https://github.com/etcd-io/etcd/pull/12251
2020-08-24 11:58:19 -04:00
Sahdev Zala
ae66916226
pkg: file stat warning (#12242)
Provide warning and doc instead of enforcing file permission.
2020-08-23 17:20:16 -07:00
gaurav
c199d3d8c3
server: use buffered channel to avoid goroutine leak (#11941)
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
2020-08-21 18:46:28 -07:00
Sam Batschelet
261aa31dc5
Merge pull request #12243 from hexfusion/bump-x/text
vendor: bump golang.org/x/text
2020-08-21 10:03:01 -04:00
Sam Batschelet
100c443a10 vendor: bump golang.org/x/text
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2020-08-21 09:14:40 -04:00
Gyuho Lee
76993f1fc6
Merge pull request #12240 from avorima/fdusage_readdirnames
etcdserver: Use Readdirnames to count fds for FDUsage
2020-08-20 21:58:18 -07:00
Brandon Philips
ab9c14f477
Merge pull request #12241 from philips/add-asset-transparency-github-action
github: workflows: add asset-transparency release action
2020-08-20 14:03:19 -07:00
Brandon Philips
142358c13d github: workflows: add asset-transparency release action
From etcd-dev discussion:
https://groups.google.com/u/2/g/etcd-dev/c/oMGSBqs_7sc

I have been working on this system called Asset Transparency[1] which
helps users verify they have received the correct contents from a URL.
If you are familiar with the "download a file, download a SHA256SUM
file, run `sha256sum -c`, etc" process? This tool helps to automate
that for users into something like this[2]:

$ tl get https://github.com/etcd-io/etcd/releases/download/v3.4.12/etcd-v3.4.12-darwin-amd64.zip

And a best practice for this Asset Transparency system is that URLs
are registered with the log as soon as possible. Why? Well, the sooner
a URL is entered the longer it can protect people consuming a URL from
unexpected content modification from say a GitHub credential
compromise.

To that end I have written a GitHub Action[3] that will automatically
do that on every release. It is easy to activate and should be hands
free after installation. So, before I enable it I want to see if there
are any concerns from maintainers. The only change to our repo will be
a new file in .github/workflows.

[1] https://www.transparencylog.com
[2] https://github.com/transparencylog/tl
[3] https://github.com/transparencylog/publish-releases-asset-transparency-action
2020-08-20 11:32:36 -07:00
Mario Valderrama
be70400fb5 etcdserver: Use Readdirnames to count fds for FDUsage
Readdir already calls Readdirnames, but continues to allocate
os.FileInfo with Lstat for each result.
2020-08-20 16:51:29 +02:00
Gyuho Lee
4b6a0eea49 CHANGELOG: update with server panic fix
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-08-19 20:02:52 -07:00
Gyuho Lee
44dea5df03
Merge pull request #12238 from liggitt/slow-v2-panic
etcdserver: Avoid panics logging slow v2 requests in integration tests
2020-08-19 09:20:47 -07:00
Jordan Liggitt
ad57fea4c5 etcdserver: Avoid panics logging slow v2 requests in integration tests 2020-08-19 11:30:15 -04:00
Gyuho Lee
cfdc296a3c CHANGELOG: update release-3.2 dates
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-08-18 09:43:45 -07:00
Gyuho Lee
edaac6e2a9 CHANGELOG: add v3.3.24 release dates
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-08-18 09:30:27 -07:00
Gyuho Lee
e37b28bd28 CHANGELOG: add v3.4.11
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-08-18 09:23:24 -07:00
OG
0526f461e1
Doc: Update curl command to fix 400 Bad Request (#11911) 2020-08-16 16:12:39 -07:00
Gyuho Lee
0e4ba37b6c
Merge pull request #12193 from mitake/integration_test
test: avoid non existing package for integration test
2020-08-15 23:26:34 -07:00
Gyuho Lee
d35933c351
Merge pull request #12221 from wenjiaswe/changelog_12215
CHANGELOG: update from 12215
2020-08-14 13:29:40 -07:00
Wenjia Zhang
32982ef469 CHANGELOG: update from 12215
Change-Id: I17e076554a56c95fabd95af111eccd8d7409966b
2020-08-14 13:18:02 -07:00
Gyuho Lee
92f9e6eba2
Merge pull request #12216 from jingyih/experimental_flag_for_watch_notify_interval
*: add experimental flag for watch notify interval
2020-08-14 12:47:43 -07:00
jingyih
799b16c2d1 CHANGELOG: update for PR12216 2020-08-14 12:06:38 -07:00
jingyih
9a698476bf *: add experimental flag for watch notify interval 2020-08-14 12:01:00 -07:00
Gyuho Lee
06f89cc4f8
Merge pull request #12212 from gyuho/logger
*: upgrade zap logger to 1.15, replace global logger
2020-08-13 09:46:44 -07:00
Gyuho Lee
93cf449205
Merge pull request #12214 from gyuho/fd
*: optimize runtime.FDUsage + add OS level FD metrics
2020-08-12 18:37:05 -07:00
Gyuho Lee
5678779665 CHANGELOG: update
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-08-12 10:32:27 -07:00
Gyuho Lee
421df2ecbb etcdserver: add OS level FD metrics
Similar counts are exposed via Prometheus.
This adds the one that are perceived by etcd server.

e.g.

os_fd_limit 120000
os_fd_used 14
process_cpu_seconds_total 0.31
process_max_fds 120000
process_open_fds 17

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-08-12 10:32:27 -07:00
Gyuho Lee
53fdcdc5a2 pkg/runtime: optimize FDUsage by removing sort
No need sort when we just want the counts.

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-08-12 10:32:24 -07:00
Gyuho Lee
d8ed233791 CHANGELOG: update
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-08-12 09:50:00 -07:00
Gyuho Lee
7eac6bd497 *: upgrade zap logger to 1.15, replace global logger
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-08-12 09:50:00 -07:00
Gyuho Lee
ed27d9d2de
Merge pull request #12198 from ptabor/20200803-int-to-string-test-fix
etcdserver, wal: Fix tests unintended CASTing of int->String.
2020-08-11 21:35:20 -07:00
Gyuho Lee
8c44d25f2a
Merge pull request #12211 from tangcong/ignore-errcompacted
etcdserver: ignore ErrCompacted error
2020-08-11 21:34:38 -07:00
Gyuho Lee
fe36be2251
Merge pull request #12195 from tangcong/optimize-healthcheck
*: check health by using v3 range request and its corresponding timeout
2020-08-11 21:32:44 -07:00
tangcong
8a4c7751d8 CHANGELOG: update for 12195 2020-08-12 08:10:13 +08:00
Gyuho Lee
18adf55c92
Merge pull request #12199 from ptabor/20200803-expect-replace-fix
tests/e2e: Update github.com/creack/pty v1.1.7 -> v1.1.11
2020-08-11 11:59:12 -07:00
Gyuho Lee
844091dda3
Merge pull request #12206 from ptabor/20200807-setLoggingDataRace
integration: Fix flakes due to .setupLogging race.
2020-08-11 11:58:47 -07:00
tangcong
afa0e8196c etcdserver: ignore mvcc.ErrCompacted error 2020-08-11 23:45:20 +08:00
Jingyi Hu
cd25d6c06e
Merge pull request #12130 from ptabor/master
functional/tester: Update cluster_test.go to reflect functional.yaml
2020-08-09 02:14:31 +08:00
Piotr Tabor
9d182c2a70
clientv3/integration: Fix flaky TestGetTokenWithoutAuth (#12200)
The test is vary flaky on Travis.

Seems that since (https://github.com/etcd-io/etcd/issues/7724) the
client is expected to simply ignore whether server is in AuthDisabled
mode even if the user supplies credentials.

The tests used to:
  * use very large cluster (10 nodes)
  * set very low timeout (1 sec)

Such setup led to frequent deadlineExceed errors or following failures:

    === RUN   TestGetTokenWithoutAuth
    {"level":"warn","ts":"2020-08-04T16:50:48.686+0200","caller":"clientv3/retry_interceptor.go:62","msg":"retrying of unary invoker failed","target":"endpoint://client-35573307-1ee5-441b-acc7-d073f0bd7de5/localhost:69820396562031027440","attempt":0,"error":"rpc error: code = Unavailable desc = etcdserver: leader changed"}
        user_test.go:151: other errors:etcdserver: leader changed
    --- FAIL: TestGetTokenWithoutAuth (10.91s)
2020-08-07 13:32:32 -07:00
Piotr Tabor
830618e44d ./integration: Fix flakes due to .setupLogging race.
The source of problem was the fact that multiple tests were creating
their clusters (and some of them were setting global grpclog).
If the test was running after some other test that created HttpServer
(so accessed grpclog), this was reported as race.

Tested with:
  go test ./clientv3/. -v "--run=(Example).*" --count=2
  go test ./clientv3/. -v "--run=(Test).*" --count=2
  go test ./integration/embed/. -v "--run=(Test).*" --count=2
2020-08-07 13:54:41 +02:00
Gyuho Lee
f395f82a75
Merge pull request #12202 from spzala/auditchangelog
CHANGELOG: update with added audit report
2020-08-05 08:56:16 -07:00
Sahdev P. Zala
eafd374309 CHANGELOG: update with added audit report
Update the changelog for recently added audit report. Also mention the
report in the security readme.
2020-08-04 22:44:48 -04:00
Sahdev Zala
d29af0f22b
Merge pull request #12201 from spzala/audit
Add audit report
2020-08-04 20:25:24 -04:00
Sahdev P. Zala
4edd2679f0 doc: add audit report
Adding audit report.
2020-08-04 19:07:18 -04:00