18701 Commits

Author SHA1 Message Date
Marek Siarkowicz
2a1055c7f3 raft: Remove dependency on etcd api
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-08 13:56:46 +01:00
Benjamin Wang
1f863f7961
Merge pull request #14703 from ahrtr/raft_remove_etcd_client_20221108
raft: remove the raft dependency on go.etcd.io/etcd/client/pkg/v3
2022-11-08 18:24:33 +08:00
Benjamin Wang
fe7da79594 raft: remove the raft dependency on go.etcd.io/etcd/client/pkg/v3
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-08 09:20:19 +08:00
Marek Siarkowicz
554b1bd0b0
Merge pull request #14687 from serathius/random-failpoint
tests: Add triggering random go failpoints to linearizability tests
2022-11-07 20:59:39 +01:00
Benjamin Wang
f64bed6033
Merge pull request #14698 from ahrtr/raft_warn_20221107
raft: change the log from debug to warning when uncommitted size exceeds threshold
2022-11-07 19:57:33 +08:00
Benjamin Wang
3e07097d77
Merge pull request #14545 from nvanbenschoten/nvanbenschoten/simplifyAutoLeave
raft: simplify auto-leave joint config on entry application logic
2022-11-07 17:20:26 +08:00
Benjamin Wang
a671e3ebd1 raft: change the log from debug to warning when uncommitted size exceeds max threshold
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-07 17:17:48 +08:00
Marek Siarkowicz
5268db50ce
Merge pull request #14677 from ahrtr/3.4.22
changelog: update 3.4.22's release date
2022-11-07 09:50:15 +01:00
Marek Siarkowicz
13dd8ef607
Merge pull request #14697 from ahrtr/hybrid_20221107
test: support mix versions testing
2022-11-07 09:49:11 +01:00
Hitoshi Mitake
0dd88467fa
Merge pull request #14659 from ahrtr/changelog_3.5_double_barrier 2022-11-07 13:01:22 +09:00
Benjamin Wang
757cf33c00 test: update e2e test cases to use e2e specfic configuration from e2e package
Afer moving `ClusterVersion` and related constants into e2e packages,
some e2e test cases are broken, so we need to update them to use the
correct definitions.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-07 10:25:04 +08:00
Benjamin Wang
86e71f026e test: update the definition of testRunner and clusterTestCases
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-07 10:18:51 +08:00
Benjamin Wang
fc23d0e83a test: add ClusterContext into the common ClusterConfig
ClusterContext is used by "e2e" or "integration" to extend the
ClusterConfig. The common test cases shouldn't care about what
data is encoded or included; instead "e2e" or "integration"
framework should decode or parse it separately.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-07 10:05:45 +08:00
Marek Siarkowicz
71b40b3abf tests: Extend common test to run previous release
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-07 06:51:59 +08:00
Benjamin Wang
b08209447a
Merge pull request #14368 from happlins/main
clientv3: fix init client error
2022-11-07 06:36:13 +08:00
Marek Siarkowicz
219278b298 tests: Add triggering random go failpoints to linearizability tests
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-06 15:56:28 +01:00
Hitoshi Mitake
6bfaf8de33
Merge pull request #14695 from ahrtr/changelog_main_20221106
changelog: add item to cover the fix on adding protection on maintenance requests when auth is enabled
2022-11-06 14:49:17 +09:00
Benjamin Wang
cda14cd3f3 changelog: add item to cover the fix on adding protection on maintenance requests when auth is enabled
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-06 13:25:35 +08:00
Benjamin Wang
e68acb1a95
Merge pull request #14693 from ahrtr/pipeline_failure_20221106
test: fix pipeline errors due to PRs conflict
2022-11-06 06:51:31 +08:00
Benjamin Wang
c00ede393f test: fix pipeline errors due to PRs conflict
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-06 06:28:51 +08:00
Hitoshi Mitake
49db50c117
Merge pull request #14663 from ahrtr/auth_20221031
auth: check permission when performing maintainenence operations if auth is enabled
2022-11-05 23:13:29 +09:00
Benjamin Wang
d71762f4f0
Merge pull request #14683 from ahrtr/test_framework_20221104
test: refactor the framework structure to make it clearer
2022-11-05 04:30:59 +08:00
Benjamin Wang
dc0273b049 test: refactor the struct to make it clearer
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-04 19:28:32 +08:00
Marek Siarkowicz
e614eec948
Merge pull request #14560 from serathius/env
tests: Pass only etcd related environment variables during e2e tests
2022-11-04 11:24:07 +01:00
Marek Siarkowicz
0dfd7264c0
Merge pull request #14681 from tbg/tbg-maintainer
(Re-) add @tbg as maintainer
2022-11-03 15:04:07 +01:00
Tobias Grieger
99d5364e57 (Re-) add @tbg as maintainer
As discussed with @serathius and @ptabor[^1].

[^1]: https://github.com/etcd-io/etcd/pull/14238#issuecomment-1268281624

Signed-off-by: Tobias Grieger <tobias.b.grieger@gmail.com>
2022-11-03 14:53:02 +01:00
Benjamin Wang
be686b1bae changelog: update 3.4.22's release date
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-03 05:04:44 +08:00
Benjamin Wang
74085136b3 etcdctl: connect to the same endpoint as the target to be maintained
The client may connect to a different endpint as the target to be
maintained. When auth is enabled, the target endpoint might haven't
finished applying the authentiation request, so it might reject the
corresponding maintenance request due to permission denied.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-03 04:55:27 +08:00
Benjamin Wang
7f46da223d client: no need to getToken when dial specific endpoint for maintenance
The existing client may connect to different endpoint from the
specific endpoint to be maintained. Maintenance operations do not
go through raft at all, so it might run into issue if the server
hasn't finished applying the authentication request.

Let's work with an example. Assuming the existing client connects to
ep1, while the user wants to maintain ep2. If we getToken again, it
sends an authentication request, which goes through raft. When the
specific endpoint receives the maintenance request, it might haven't
finished previous authentication request, but the new token is already
carried in the context, so it will reject the maintenance request
due to invalid token.

We already have retry logic in `unaryClientInterceptor` and
`streamClientInterceptor`. When the token expires, it can automatically
refresh the token, so it should be safe to remove the `getToken`
logic in `maintenance.dial`

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-03 04:39:42 +08:00
Benjamin Wang
f782891246 test: added auth test on maintenance API
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-03 04:39:42 +08:00
Benjamin Wang
1791ab5754 test: add common functions for auth test
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-03 04:39:42 +08:00
Benjamin Wang
c967715d93 auth: protect all maintainence APIs when auth is enabled
All maintenance APIs require admin privilege when auth is enabled,
otherwise, the request will be rejected. If auth isn't enabled,
then no such requirement any more.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-03 04:39:42 +08:00
Marek Siarkowicz
7ed4eda4c1
Merge pull request #14657 from fuweid/test-fix-TestDowngradeUpgradeClusterOf3
test: deflake TestDowngradeUpgradeClusterOf3 timeout
2022-11-02 16:51:24 +01:00
Wei Fu
3ddcb3ddef test: deflake TestDowngradeUpgradeClusterOf3 timeout
In the TestDowngradeUpgradeCluster case, the brand-new cluster is using
simple-config-changer, which means that entries has been committed
before leader election and these entries will be applied when etcdserver
starts to receive apply-requests. The simple-config-changer will mark
the `confState` dirty and the storage backend precommit hook will update
the `confState`.

For the new cluster, the storage version is nil at the beginning. And
it will be v3.5 if the `confState` record has been committed. And it
will be >v3.5 if the `storageVersion` record has been committed.

When the new cluster is ready, the leader will set init cluster version
with v3.6.x. And then it will trigger the `monitorStorageVersion` to
update the `storageVersion` to v3.6.x. If the `confState` record has
been updated before cluster version update, we will get storageVersion
record.

If the storage backend doesn't commit in time, the
`monitorStorageVersion` won't update the version because of `cannot
detect storage schema version: missing confstate information`.

And then we file the downgrade request before next round of
`monitorStorageVersion`(per 4 second), the cluster version will be
v3.5.0 which is equal to the `UnsafeDetectSchemaVersion`'s result.
And we won't see that `The server is ready to downgrade`.

It is easy to reproduce the issue if you use cpuset or taskset to limit
in two cpus.

So, we should wait for the new cluster's storage ready before downgrade
request.

Fixes: #14540

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2022-11-02 22:50:31 +08:00
Marek Siarkowicz
e25090f3fb
Merge pull request #14678 from ahrtr/go1.19.3
bump go version to 1.19.3 to address security fixes
2022-11-02 12:12:48 +01:00
Benjamin Wang
94e0c2410b bump go version to 1.19.3 to address security fixes
FYI. https://groups.google.com/g/golang-announce/c/dRtDK7WS78g

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-02 09:07:22 +08:00
Marek Siarkowicz
2e790d2c4f
Merge pull request #14664 from spacewander/ra1
ci: ensure the generated code is up-to-date
2022-11-01 13:21:57 +01:00
Benjamin Wang
06ff2c905f
Merge pull request #14667 from cenkalti/range-panic
server: add more context to panic message
2022-11-01 17:39:03 +08:00
Cenk Alti
580a86ebe5
server: add more context to panic message
Signed-off-by: Cenk Alti <cenkalti@gmail.com>
2022-10-31 20:29:15 -04:00
spacewander
a774510a90 address review
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2022-10-31 21:23:48 +08:00
spacewander
e73a25a1d0 ci: ensure the generated code is up-to-date
See https://github.com/etcd-io/etcd/pull/14612#issue-1419792069
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2022-10-31 19:58:21 +08:00
Benjamin Wang
5073af6521
Merge pull request #14660 from clarkfw/new-cluster-accept-configuration-as-options
tests: TestRunner.NewCluster accepts options
2022-10-31 19:15:23 +08:00
Clark
fa9ee5cce9 tests: TestRunner.NewCluster accepts options
Signed-off-by: Clark <fwyongxing@gmail.com>
2022-10-31 15:26:08 +08:00
Benjamin Wang
378da24c79 changelog: add item to cover the fix for double barrier running into stack overflow error
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-10-31 08:24:58 +08:00
Benjamin Wang
a1018dbddf
Merge pull request #14604 from ahrtr/double_barrier
clientv3: fix the implementation of double barrier
2022-10-31 08:13:12 +08:00
Benjamin Wang
d1f7136a50
Merge pull request #14621 from ahrtr/functional_test_20221025
test: terminate functional test on failure and code cleanup
2022-10-31 07:42:29 +08:00
Benjamin Wang
0a19ee7a11
Merge pull request #14650 from mitake/changelog-14574
update changelogs of 3.4 and 3.5 for backporting PR 14574 and 14647
2022-10-29 13:47:34 +08:00
Hitoshi Mitake
d0f5f1ba20 update changelogs of 3.4 and 3.5 for backporting PR 14574 and 14647
Signed-off-by: Hitoshi Mitake <h.mitake@gmail.com>
2022-10-29 14:24:04 +09:00
Benjamin Wang
aeaa1f8b27
Merge pull request #14647 from mitake/auth-testrecover
server: add a unit test case for authStore.Reocver() with empty rangePermCache
2022-10-29 12:47:24 +08:00
Hitoshi Mitake
b7146f8f33 server: add a unit test case for authStore.Reocver() with empty rangePermCache
Signed-off-by: Hitoshi Mitake <h.mitake@gmail.com>
2022-10-29 12:54:34 +09:00