Commit Graph

1121 Commits (dependabot/go_modules/go.uber.org/atomic-1.10.0)

Author SHA1 Message Date
Marek Siarkowicz 3e5fc2e4fc tests: Enable BlackholeUntilSnapshot robustness scenario
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-20 11:15:42 +01:00
Wei Fu a9988e2625 server/embed: fix data race when start insecure grpc
There are two goroutines accessing the `gs` grpc server var. Before
insecure `gs` server start, the `gs` can be changed to secure server and
then the client will fail to connect to etcd with insecure request. It
is data-race. We should use argument for reference in the new goroutine.

fix: #15495

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-03-18 21:48:58 +08:00
Benjamin Wang f9bdd8c96c
Merge pull request #15502 from chaochn47/deflake_TestMemberList
deflake member_test: enable pre-vote by default and add retry
2023-03-18 07:55:02 +08:00
Benjamin Wang 6cfe4bcf1f
Merge pull request #15501 from chaochn47/defake_TestTracing
deflake TestTracing
2023-03-18 07:24:02 +08:00
Chao Chen d7f992c351 enable pre-vote by default and add retry on member_test
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-03-17 15:15:13 -07:00
Chao Chen f163af2bc8 deflake TestTracing
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-03-17 14:39:18 -07:00
Marek Siarkowicz dfc2c6d44b tests: Add connection muiltiplexer testing
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-15 15:56:39 +01:00
Marek Siarkowicz aad24ebe2a tests: Extract e2e test utils
Consider creating generic testutils for both e2e and integration tests.

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-15 14:47:49 +01:00
Marek Siarkowicz cbf819740e tests: Allow specifying http version in curl
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-15 09:27:51 +01:00
Marek Siarkowicz ae30e5c2fb tests: Refactor newClient args
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-15 09:27:51 +01:00
Marek Siarkowicz e87abf3f13 tests: Refactor CURLPrefixArgs
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-14 16:35:43 +01:00
Marek Siarkowicz 67e3c784ba tests: Remove MetricsURLScheme field
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-14 16:35:43 +01:00
Benjamin Wang 7f37b3630f
Merge pull request #15453 from serathius/refactor-url-names
Refactor url names
2023-03-14 08:09:49 +08:00
Benjamin Wang a141585b1c test: fix format error
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-14 05:53:53 +08: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
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
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 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
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
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
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
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
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
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
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
Chao Chen d798816baf migrate auth tests to common #6
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-02-28 10:32:29 -08:00
Benjamin Wang 5f872589cd dependency: bump golang.org/x/sync to v0.1.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-28 06:56:16 +08:00
Benjamin Wang 6af2c9dbfa dependency: bump golang.org/x/crypto to v0.6.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-28 06:51:55 +08:00
Benjamin Wang f333148da9 dependency: bump golang.org/x/time to v0.3.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-28 06:49:39 +08:00
Benjamin Wang d8b8127084 dependency: bump github.com/stretchr/testify from 1.8.1 to 1.8.2
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-28 06:44:33 +08:00
Benjamin Wang da4bf0f76f
Merge pull request #15261 from ahrtr/memberlist_20230208
clientv3: support serializable `MemberList` operation
2023-02-28 06:26:38 +08:00
Marek Siarkowicz d475cf81a0 tests: Rename linearizability tests to robustness
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-02-26 14:36:18 +01:00
Benjamin Wang 1f0d361848 clientv3: support serializable MemberList operation
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-25 07:23:39 +08:00
Chao Chen b93745a862 migrate to auth test #4
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-02-23 10:46:31 -08:00
Benjamin Wang de9c0f8fea dependency: bump github.com/golang-jwt/jwt/v4 to v4.5.0
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-21 05:29:53 +08:00
xin.li b17b9c1428 chore: Use http constants to replace numbers as parameters
Signed-off-by: xin.li <xin.li@daocloud.io>
2023-02-20 11:53:41 +08:00
WangXiaoxiao 8e56e2f5ce add mix version for snapshot e2e case
Signed-off-by: WangXiaoxiao <1141195807@qq.com>
2023-02-18 18:01:48 +08:00
Benjamin Wang a7e94c4843 security: bump golang.org/x/net to v0.7.0 to address CVE GO-2023-1571
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-17 11:29:47 +08:00
Marek Siarkowicz c24ba4d3e8
Merge pull request #15320 from chaochn47/migrate_auth_tests_to_common
migrate 6 auth test cases to common #3
2023-02-16 11:40:34 +01:00
Marek Siarkowicz e603d92727
Merge pull request #15325 from serathius/linearizability-refactor-report
tests: Refactor file structure
2023-02-16 11:23:56 +01:00
James Blair ee6781bf6f Bump to go 1.19.6
go 1.19.6 (released 2023-02-14) includes important security and bug fixes.

Signed-off-by: James Blair <mail@jamesblair.net>
2023-02-16 17:12:59 +08:00
Chao Chen c36ea3fdcf migrate auto tests to common #3
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-02-15 11:08:01 -08:00
Marek Siarkowicz a36951ad18 tests: Extract report related functions and clean up main file
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-02-15 16:13:43 +01:00
Marek Siarkowicz 116a3150c0
Merge pull request #15282 from serathius/linearizability-report-watch
test: Report watch histories
2023-02-15 16:00:10 +01:00
Marek Siarkowicz edfc963302 tests: Detect duplicate watch event
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-02-15 13:59:03 +01:00
Marek Siarkowicz 0cd5c9ca37 tests: Refactor reporting results
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-02-15 13:02:42 +01:00