Commit Graph

280 Commits

Author SHA1 Message Date
b32ac1f67b fix a typo: print the correct error info 2022-05-19 07:19:44 +08:00
e7f8bf7c44 enhance the /version endpoint to add storageVersion 2022-05-06 20:29:42 +08:00
26f42e7a9e server: Apply review comments and split basic handler 2022-05-05 09:52:14 +02:00
fb361e43f0 server: Split code for debug and version endpoints 2022-05-05 09:52:14 +02:00
722ec487df server: Split metrics and health code 2022-05-05 09:52:14 +02:00
600ee13ac0 server: Cover V3 health with tests 2022-05-05 09:52:14 +02:00
e9dec74ded server: Refactor health checks 2022-05-05 09:52:14 +02:00
191aed645e server: Run health check tests in subtests 2022-05-05 09:52:14 +02:00
e4e391792a server: Rename test case expect fields 2022-05-05 09:52:13 +02:00
0fb194d6f2 server: Use named struct initialization in healthcheck test 2022-05-05 09:52:13 +02:00
0096d2ecdb server: Remove unused NewClientHandler 2022-05-05 09:52:13 +02:00
1b3d6cb0c8 set an separate applyTimeout for the waitAppliedIndex 2022-04-10 14:44:55 +08:00
d659403955 Update server/etcdserver/api/v3rpc/maintenance.go
Co-authored-by: Marek Siarkowicz <marek.siarkowicz@protonmail.com>
2022-04-08 18:45:13 +01:00
4c8ef011e0 *: drop use of humanize.Time() in favour of time.Duration.String()
humanize.Time() drops precision resulting in some events reporting they took
"now" time to complete. Using time.Duration.String() results in accurate
duration being reported.

Fixes #13905
2022-04-07 23:24:35 +01:00
804fddf921 tests: Use zaptest.NewLogger in tests 2022-04-04 13:03:15 +02:00
2ed87b9f2f skip compact when rev not change at period compact mode 2022-03-24 20:59:25 +08:00
f978da4f4f move the newClientCfg into clientv3 package so as to be reused by both etcdctl and v3discovery 2022-03-24 06:18:25 +08:00
edce939f6e add one more field storageVersion into StatusResponse
When performing the downgrade operation, users can confirm whether each member
is ready to be downgraded using the field 'storageVersion'. If it's equal to the
'target version' in the downgrade command, then it's ready to be downgraded;
otherwise, the etcd member is still in progress of processing the db file.
2022-03-18 07:04:44 +08:00
1a3822f2c3 Rename ClientConfig to ConfigSpec
The ClientConfig is a fully declarive configuration, so it makes more
sense to rename it to ConfigSpec. It can also mitigate the confusion
between Config and ClientConfig.
2022-03-13 05:41:49 +08:00
3dcbbf62d9 Move clientconfig into clientv3 so that it can be reused by both etcdctl and v3 discovery 2022-03-12 06:38:41 +08:00
2f36e0c62b Change discovery url to endpoints
Currently the discovery url is just one endpoint. But actually it
should be the same as the etcdctl, which means that it should be
a list of endpoints. When one endpoint is down, the clientv3 can
fail over to the next endpoint automatically.
2022-02-24 09:11:41 +08:00
b5e224db7d Merge pull request #13635 from ahrtr/v3_discovery
support v3 discovery to bootstrap a new etcd cluster
2022-02-21 21:50:40 +01:00
f80f477073 Merge pull request #13644 from Juneezee/refactor/t.TempDir
*: use `T.TempDir` to create temporary test directory
2022-02-21 19:52:37 +01:00
ebc86d12c0 support v3 discovery to bootstrap a new etcd cluster 2022-02-21 23:22:49 +08:00
8681888012 fix typo, renamed ErrGPRCNotSupportedForLearner to ErrGRPCNotSupportedForLearner 2022-02-21 14:46:58 +08:00
a63fa17b76 Merge pull request #13645 from yangxuanjia/yxjetcd_fix_panic_when_restart_after_removeMember
fix panic when restart after removeMember
2022-02-20 12:28:14 +01:00
d108a241d0 fix panic when restart after removeMember
fix panic when restart after removeMember

fix panic when restart after removeMember
2022-01-26 16:03:00 +08:00
692b3c4cd7 server: Remove most of V2 API 2022-01-25 15:24:13 +01:00
e9edc5432c *: use T.TempDir to create temporary test directory
The directory created by `T.TempDir()` and is automatically removed when
the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-01-25 00:00:46 +08:00
a1fb9ff1e4 Merge pull request #13621 from serathius/integration-v2-api
Remove V2 API usage from Integration tests
2022-01-24 12:28:42 +01:00
87c8e8b868 test: Migrate to ClusterV3 cluster in integration tests 2022-01-20 14:10:09 +01:00
15568f4c00 add protection code for Range when the sortTarget is an invalid value 2022-01-18 07:46:37 +08:00
f8aafea504 add protection code to prevent etcd from panic when the client api version is not valid UTF-8 2022-01-17 06:21:22 +08:00
f4266e2d75 Merge pull request #13575 from AdamKorcz/fuzz1
v2auth: fix out of bounds in test
2022-01-15 23:30:10 -05:00
ee5ef42c5c server: --enable-v2 and --enable-v2v3 is decomissioned 2022-01-14 13:19:30 +01:00
6aac35dd32 v2auth: fix out of bounds in test 2022-01-10 19:06:07 +00:00
d357f9b361 Merge pull request #13399 from ahrtr/serializable_health_check
Enhance health check endpoint to support serializable request
2021-11-15 11:46:55 -05:00
29c3b0f307 Merge pull request #13377 from hexfusion/add-learner-limit-flag
Add experimental-max-learners flag
2021-11-15 09:49:18 -05:00
09ff05108b enhance health check endpoint to support serializable request 2021-11-15 05:57:54 +08:00
f6f27d32d1 server/etcdserver/api/etcdhttp: exclude the same alarm type activated by multiple peers 2021-11-09 11:33:59 -08:00
63a1cc3fe4 add --experimental-max-learner flag
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2021-11-09 09:52:00 -05:00
fd0b98b6c0 Merge pull request #13404 from JmPotato/refine_periodic
v3compactor: refine some code and fix a typo
2021-10-29 23:25:23 +02:00
6c2f5dc78a Merge pull request #13405 from serathius/downgrade-b
Implement single node downgrades
2021-10-29 23:22:10 +02:00
758fc0f8ad server: Depend only on cluster version to detect downgrade
Problem with old code was that during downgrade only members with
downgrade target version were allowed to join. This is unrealistic as
it doesn't handle any members to disconnect/rejoin.
2021-10-29 12:47:17 +02:00
2a151c8982 *: move from io/ioutil to io and os packages
The io/ioutil package has been deprecated as of Go 1.16, see
https://golang.org/doc/go1.16#ioutil. This commit replaces the existing
io/ioutil functions with their new definitions in io and os packages.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2021-10-28 00:05:28 +08:00
923f0aa3e7 etcdserver: Expose metrics with all known peers
To make it possible to alert on misconfigured etcd clusters that have
missing/superfluous peers, expose the list of peers as a metric.
This metric can, for example, be compared to the control-plane nodes of
a kubernetes cluster.
2021-10-09 14:27:10 +02:00
f92b4f9a28 server: Integrate version validation logic into tests 2021-10-08 12:01:54 +02:00
e47c3c22d2 server: Move downgrade API logic into version package 2021-10-08 12:01:51 +02:00
1e5e57f268 server: Move downgrade detection code to version package 2021-10-08 10:41:37 +02:00
471a804665 Remove the unnecessary code
Signed-off-by: JmPotato <ghzpotato@gmail.com>
2021-10-08 14:59:41 +08:00