19560 Commits

Author SHA1 Message Date
Benjamin Wang
cff96fe3a4
Merge pull request #15473 from jmhbnz/main
Refactor: Use proper variable names for urls
2023-03-14 14:25:25 +08:00
James Blair
f6ebff1557
Refactor: Use proper variable names for urls.
Signed-off-by: James Blair <mail@jamesblair.net>
2023-03-14 18:37:52 +13:00
Benjamin Wang
3fc23ab9a0
Merge pull request #15456 from etcd-io/dependabot/go_modules/tools/mod/github.com/mikefarah/yq/v4-4.31.2
build(deps): bump github.com/mikefarah/yq/v4 from 4.31.1 to 4.31.2 in /tools/mod
2023-03-14 10:27:25 +08:00
Benjamin Wang
6385c7d8ae
Merge pull request #15455 from samruddhikhandale/samruddhikhandale/update-contributing
Update CONTRIBUTING.md reference for Codespaces
2023-03-14 09:35:13 +08:00
dependabot[bot]
263dc15a38
build(deps): bump github.com/mikefarah/yq/v4 in /tools/mod
Bumps [github.com/mikefarah/yq/v4](https://github.com/mikefarah/yq) from 4.31.1 to 4.31.2.
- [Release notes](https://github.com/mikefarah/yq/releases)
- [Changelog](https://github.com/mikefarah/yq/blob/master/release_notes.txt)
- [Commits](https://github.com/mikefarah/yq/compare/v4.31.1...v4.31.2)

---
updated-dependencies:
- dependency-name: github.com/mikefarah/yq/v4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-14 00:40:03 +00:00
Benjamin Wang
eba5845db0
Merge pull request #15466 from etcd-io/dependabot/github_actions/github/codeql-action-2.2.6
build(deps): bump github/codeql-action from 2.2.5 to 2.2.6
2023-03-14 08:17:38 +08:00
Benjamin Wang
7f37b3630f
Merge pull request #15453 from serathius/refactor-url-names
Refactor url names
2023-03-14 08:09:49 +08:00
Piotr Tabor
bea9c95b77
Merge pull request #15467 from ahrtr/fix_format_20230314
test: fix format error
2023-03-13 23:56:48 +01:00
Benjamin Wang
a141585b1c test: fix format error
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-14 05:53:53 +08:00
dependabot[bot]
97a080ba1e
build(deps): bump github/codeql-action from 2.2.5 to 2.2.6
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.2.5 to 2.2.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](32dc499307...16964e90ba)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-13 18:05:12 +00:00
Samruddhi Khandale
cd219ca8df Update CONTRIBUTING.md reference for Codespaces
Signed-off-by: Samruddhi Khandale <samruddhikhandale@github.com>
2023-03-13 17:39:17 +00:00
Marek Siarkowicz
372042c374 refactor: Use proper variable names for urls
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-13 14:48:01 +01:00
Marek Siarkowicz
043525c69d
Merge pull request #15449 from fuweid/fix-15409
tests/integration: deflake TestEtcdVersionFromWAL
2023-03-13 10:36:02 +01:00
tangcong
ad72900dad server/auth: fix auth panic bug when user changes password
Signed-off-by: tangcong <tangcong506@foxmail.com>
2023-03-12 20:49:09 +08:00
Wei Fu
22bdc91302 server/etcdserver: add log for terminating monitors
Adding log for terminating monitors is to make the debug easier.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-03-11 15:07:17 +08:00
Wei Fu
4a9ad47bcc tests/integration: deflake #15409
The cluster version will be initialized after the member becomes leader.
The update is handled asynchronously. It couldn't be updated if the member
has been closed and the go-runtime picks the `s.stopping` channel first.

```go
// e2a5df534c/server/etcdserver/server.go (L2170)

func (s *EtcdServer) monitorClusterVersions() {
	...
	for {
		select {
		case <-s.firstCommitInTerm.Receive():
		case <-time.After(monitorVersionInterval):
		case <-s.stopping:
			return
		}
		...
	}
}
```

Or after the `s.stopping` has been closed, the [UpdateClusterVersion][1] won't
file GoAttach successfully. For the #15409, we can see the warn log
`server has stopped; skipping GoAttach` from GoAttach:

```plain
https://github.com/etcd-io/etcd/actions/runs/4340931587/jobs/7580103902

    logger.go:130: 2023-03-06T07:36:44.253Z	WARN	default	stopping grpc server due to error	{"error": "accept tcp 127.0.0.1:2379: use of closed network connection"}
    logger.go:130: 2023-03-06T07:36:44.253Z	WARN	default	stopped grpc server due to error	{"error": "accept tcp 127.0.0.1:2379: use of closed network connection"}
    logger.go:130: 2023-03-06T07:36:44.253Z	ERROR	default	setting up serving from embedded etcd failed.	{"error": "accept tcp 127.0.0.1:2379: use of closed network connection"}
    logger.go:130: 2023-03-06T07:36:44.253Z	ERROR	default	setting up serving from embedded etcd failed.	{"error": "http: Server closed"}
    logger.go:130: 2023-03-06T07:36:44.253Z	INFO	default	skipped leadership transfer for single voting member cluster	{"local-member-id": "8e9e05c52164694d", "current-leader-member-id": "8e9e05c52164694d"}

    logger.go:130: 2023-03-06T07:36:44.253Z	WARN	default	server has stopped; skipping GoAttach

    ...
```

If the cluster version isn't updated, the minimum storage version will
be v3.5 because the [AuthStatus][2] is introduced in [v3.5][3].
The compare will fail.

To fix this issue, we should wait for cluster version to become ready
after server is ready to serve request.

[1]: <e2a5df534c/server/etcdserver/adapters.go (L45)>
[2]: <071e70cdc4>
[3]: <1b4e54c238>

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-03-11 14:50:37 +08:00
Benjamin Wang
e2a5df534c
Merge pull request #15447 from nullc4t/main
FIX #13389
2023-03-11 05:36:24 +08:00
anon
4dad1ed71e FIX #13389
Dummy fix. Implement wsproxy.Logger with zap.Logger. Use sctx.lg as logger.

Signed-off-by: anon <thisisnot@myemail.com>
2023-03-10 19:58:09 +02:00
Marek Siarkowicz
659c74e60e
Merge pull request #15431 from serathius/watch-random-scheduler
Watch random scheduler
2023-03-10 13:29:54 +01:00
Marek Siarkowicz
f3533f2593 server: Switch back to random scheduler to improve resilience to watch starvation
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-10 12:42:34 +01:00
Marek Siarkowicz
585dfe0186 test: Test etcd watch stream starvation under high read response load when sharing the same connection
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-10 12:42:33 +01:00
Marek Siarkowicz
b3bb996880
Merge pull request #15420 from ahrtr/dependency_20230307
Bump some dependencies
2023-03-09 13:03:56 +01:00
Marek Siarkowicz
12d7a32974
Merge pull request #15433 from jmhbnz/main
Update contributing guide with new codespaces developement option
2023-03-09 13:01:52 +01:00
James Blair
b4c499ed7a
Update contributing docs with new codespaces developement option.
Signed-off-by: James Blair <mail@jamesblair.net>
2023-03-09 22:28:25 +13:00
Benjamin Wang
6bd7660079
Merge pull request #15427 from jmhbnz/main
Updated go to latest 1.19.7 release
2023-03-08 19:06:12 +08:00
James Blair
5b3497555f
Updated go to 1.19.7.
Mitigates CVE-2023-24532.

Signed-off-by: James Blair <mail@jamesblair.net>
2023-03-08 21:39:31 +13:00
Benjamin Wang
24f5d4a6fb
Merge pull request #15201 from dbadoy/main
pkg/schedule: correct comparison for FIFO schedule test
2023-03-08 14:46:58 +08:00
dbadoy4874
ebb5e74ace pkg/schedule:correct comparison for FIFO schedule test
Signed-off-by: dbadoy4874 <dbadoy4874@gmail.com>
2023-03-08 13:18:05 +09:00
Benjamin Wang
aaa8bfee99
Merge pull request #15425 from fuweid/update-TestLeasingDeleteRangeContendTxn
tests/integration: Update TestLeasingDeleteRangeContendTxn
2023-03-08 08:08:38 +08:00
Wei Fu
3419230eea tests/integration: Update TestLeasingDeleteRangeContendTxn
The TestLeasingDeleteRangeContendTxn is trying to test for RangeDelete when
the target resources are being updated.  When the `txnLeasing` wants a
server-side transaction, it needs to ensure all the keys mod revision should
be leass than what it saw. If the compare fails, it will repeat to apply the
server-side transaction until it is sucessful. I believe the test-case is
trying to verify how the `txnLeasing` handles the race issue.

Before the patch #15401, the resource-updating goroutine keeps updating until
the RangeDelete finishes. The testcase is flaky because two goroutines are
sharing one `ctx` and grpc-go client won't wait for the response if `ctx`
has been canceled.

For example,

| DelLease Goroutine   | PutLease Goroutine         | ETCD Server                    | Key/0 Status |
| --                   | ---                        | --                             | --           |
| deleted              |                            |                                | version = 0  |
|                      | send update(key/0=123) req | received update(key/0=123) req | version = 0  |
| cancel               |                            |                                | version = 0  |
|                      | exit because of cancel     |                                | version = 0  |
| get key/0 by putkv   |                            |                                | version = 0  |
|                      |                            | applied update(key/0=123)      | version = 1  |
| get key/0 by raw-cli |                            |                                | version = 1  |

So `raw-cli` gets `[key/0=123]` while the `putkv` gets `[]`. If `putkv`
applies two update reqs to ETCD server and the last one is canceled
before apply, the error will be like:

```
expected [key:"key/0" version:2 value:"123" ], got [key:"key/0" version:1 value:"123" ]
```

The resource-updating goroutine should not share the ctx with RangeDelete here.
And I also revert current main branch because the resource-update goroutine
only updates 8 times and might exit before `RangeDelete`. In this case,
the `txnLeasing` is not handling the race issue.

Fixes: #15352

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-03-07 23:11:41 +08:00
Göran Gustafsson
1002346ceb
etcd-mixin: Limit etcdDatabaseHighFragmentationRatio to 100MB+
Signed-off-by: Göran Gustafsson <gustafsson.g@gmail.com>
2023-03-07 14:58:58 +01:00
Benjamin Wang
7ed1219861 dependency: bump golang.org/x/net to v0.8.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-07 06:52:07 +08:00
Benjamin Wang
b53d63219a dependency: bump github.com/cheggaaa/pb/v3 to v3.1.2
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-07 06:17:01 +08:00
Marek Siarkowicz
76a563608e
Merge pull request #15408 from jmhbnz/main
Return default snapshot count to 10,000
2023-03-06 10:23:35 +01:00
James Blair
275e10bcf7
Return default snapshot count to 10,000.
The huge (100k+) value was justified when storev2 was being dumped completely with every snapshot.

With storev2 being decomissioned we can checkpoint more frequently for faster recovery.

Signed-off-by: James Blair <mail@jamesblair.net>
2023-03-06 20:21:03 +13:00
Benjamin Wang
7a98ab3ae0
Merge pull request #15378 from chaochn47/auth_test_split_5
migration auth tests to common #5
2023-03-04 07:07:02 +08:00
Benjamin Wang
69ce1aab54
Merge pull request #15405 from jmhbnz/main
CHANGELOG: Add entries for 3.4 and 3.5 go version 1.19.
2023-03-04 05:03:01 +08:00
Chao Chen
c002e096b5 migration auth tests to common #5
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-03-03 12:26:36 -08:00
Benjamin Wang
28d965b578
Merge pull request #15383 from jmhbnz/feat/add_devcontainer
Add initial .devcontainer for go 1.19
2023-03-04 04:24:05 +08:00
James Blair
8c18bf8bc4
Add CHANGELOG entries for 3.4 and 3.5 go version 1.19.
Signed-off-by: James Blair <mail@jamesblair.net>
2023-03-04 08:47:56 +13:00
Marek Siarkowicz
85bd9d7719
Merge pull request #15401 from tjungblu/racefix_15352
Fixing flaky TestLeasingDeleteRangeContendTxn
2023-03-03 12:23:25 +01:00
Thomas Jungblut
63964ec781 Fixing flaky TestLeasingDeleteRangeContendTxn
Fixes etcd-io#15352.
Depending on the goroutine scheduling, the expected count of 8 might not
have been reached yet. This ensures the routine won't stop earlier than
that.

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
2023-03-03 11:38:22 +01:00
Piotr Tabor
d358e35f3e
Merge pull request #15379 from chaochn47/auth_test_split_6
migrate auth tests to common #6
2023-03-03 10:55:28 +01:00
Piotr Tabor
c0f37bb5d5
Merge pull request #15384 from xakdwch/main
rpctypes: use status.Error() instead of status.New().Err()
2023-03-03 10:48:23 +01:00
Piotr Tabor
dff5d1e996
Merge pull request #15398 from xakdwch/feature-enhance
rafthttp: replace inline code with existing function
2023-03-03 10:47:09 +01:00
Benjamin Wang
2e0cafce29
Merge pull request #15399 from ahrtr/dependency_20230303
dependency: bump go.opentelemetry.io/otel to v1.14.0
2023-03-03 17:41:11 +08:00
Benjamin Wang
56423eacd2 dependency: bump go.opentelemetry.io/otel to v1.14.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-03 15:44:47 +08:00
xakdwch
c767f429f0 rafthttp: replace inline code with existing function
The isMsgApp function implements the judgment of the MsgApp message,
use the isMsgApp function instead.

Signed-off-by: xakdwch <xakdwch5@gmail.com>
2023-03-03 09:50:14 +08:00
James Blair
9783253788
Add initial .devcontainer for go.19.
When the devcontainer starts it will run make build to ensure compiled binaries are immediately available for use.

I've confirmed make test is also behaving as expected within the devcontainer.

Signed-off-by: James Blair <mail@jamesblair.net>
2023-03-03 07:03:25 +13:00
Marek Siarkowicz
d4acc0ad9f
Merge pull request #15313 from serathius/dependabot-root
workflows: Remove non-root gomod dependabot rules
2023-03-02 10:17:29 +01:00