477 Commits

Author SHA1 Message Date
tangcong
4acaa5a2a0 etcdserver/api/etcdhttp: add reason field for /health response 2020-06-10 11:14:56 +08:00
CFC4N
3082a7d521
etcdserver/api/v2store: fix race in TestIssue2746WithThree (#11982) 2020-06-09 19:11:08 -07:00
Gyuho Lee
62f1fefe4a
Merge pull request #11959 from tedyu/store-clone-rd-lock
etcdserver: take read lock when cloning store
2020-06-03 14:13:53 -07:00
Gyuho Lee
a09533d63d
Merge pull request #11960 from tedyu/internal-create-err-chk
etcdserver: check error return for store#internalCreate
2020-06-03 14:13:19 -07:00
Gyuho Lee
be0639090d
Merge pull request #11939 from tedyu/chk-ret-from-write
etcdserver: check the error return from Write()
2020-06-03 14:12:50 -07:00
Ted Yu
5c95114190 etcdserver: check the error return from Write()
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2020-05-31 09:27:01 -07:00
Ted Yu
17483944fc etcdserver: check error return for store#internalCreate
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2020-05-31 09:20:05 -07:00
Ted Yu
59ec251812 etcdserver: take read lock when cloning store
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2020-05-31 09:08:26 -07:00
Ted Yu
df57a68b47 Check events against nil
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2020-05-22 13:35:25 -07:00
Gyuho Lee
cac53867ac rafthttp: log snapshot download
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-05-20 10:55:43 -07:00
Gyuho Lee
1fd1318409 etcdserver/api/rafthttp: improve snapshot send logging
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-05-18 02:29:20 -07:00
Gyuho Lee
5e2815e9cd
Merge pull request #11801 from YoyinZyc/downgrade-server
[Etcd downgrade] Implement downgrade validate, enable and cancel
2020-05-17 22:47:16 -07:00
Ted Yu
f35015abc5 etcdserver: snapNames() should exclude orphaned defragmentation file
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2020-05-17 14:19:33 -07:00
Gyuho Lee
8b50f4e11d
Merge pull request #11899 from tedyu/rel-snap-db
etcdserver: continue releasing snap db in case of error
2020-05-17 14:01:33 -07:00
Ted Yu
b84d257b92 etcdserver: continue releasing snap db in case of error
Signed-off-by: Ted Yu <yuzhihong@gmail.com>
2020-05-16 04:43:55 -07:00
yoyinzyc
37e598a20b etcdserver: define error string and link with grpc error code. 2020-05-15 11:51:39 -07:00
Gyuho Lee
4ddcc36057 etcdserver/api/v3rpc: document, clean up snapshot sends
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-05-14 22:57:52 -07:00
Gyuho Lee
f1179fd70d etcdserver/api/snap: update format string in "ReleaseSnapDBs"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-05-14 22:57:20 -07:00
Joe Betz
743e6e92cb etcdserver/*, wal/*: Remove orphaned .snap.db files during Release 2020-05-14 15:16:51 -07:00
Joe Betz
bd16071846
etcdserver/*, wal/*: find valid snapshots by cross checking snap files and wal snap entries 2020-05-14 09:22:45 -07:00
Viacheslav Biriukov
9162cd613d
etcdserver/*, wal/*: changes to snapshots and wal logic to fix #10219 2020-05-13 08:42:03 -07:00
Xiang Li
d9d850c885
rafthttp: add snapshot limit const (#11846) 2020-05-04 23:26:22 -07:00
Brandon Philips
96cce208c2 go.mod: use go.etcd.io/etcd/v3 versioning
This change makes the etcd package compatible with the existing Go
ecosystem for module versioning.

Used this tool to update package imports:
  https://github.com/KSubedi/gomove
2020-04-28 00:57:35 +00:00
yoyinzyc
f2c5dd4aa2 membership: add downgradeInfo to cluster; add getter and setter of downgradeInfo 2020-04-16 12:01:33 -07:00
Changxin Miao
73b936b50a etcdserver: watch stream got closed once one request is not permitted (#11708) 2020-04-06 13:43:37 +08:00
jingyih
0344b70906 *: make MemberList linearizable
- Add linearizable field to etcdserverpb.MemberListRequest.
- Change behavior of clienv3 MemberList API. Now it is served with
linearizable guarantee.
2020-03-25 20:16:20 -07:00
Gyuho Lee
71a241e876
Merge pull request #11715 from YoyinZyc/downgrade-api
[Etcd downgrade] Add downgrade related api in server side
2020-03-24 21:31:51 -07:00
fengpf
1f70c0b075 *: fix goroutines typos 2020-03-24 15:33:47 +08:00
yoyinzyc
073bc22d35 etcdserver: add downgrade api in maintenance server. 2020-03-22 22:35:08 -07:00
yoyinzyc
d8b9b54348 etcdserver: add downgrade rpc proto api. 2020-03-20 17:37:26 -07:00
Gyuho Lee
92f180c574 *: log server-side /health checks
To make it easier to root-cause when /health check fails.
For example, we are using load balancer to health check
each etcd instance, and when one etcd node gets terminated,
it's hard to tell whether etcd "server" was really failing
or client (or load balancer") failed to reach the etcd cluster
which is also failure in load balancer health check.

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-03-18 11:14:05 -07:00
Gyuho Lee
33907477dd *: add "etcd_server_client_requests_total", tests
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-03-17 12:16:11 -07:00
Gyuho Lee
58ba322bb4 clientv3: embed API version
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-03-17 12:16:11 -07:00
Grigorii Sokolik
a33e1b5fae etcdserver/api/etcdhttp: checkHealth refactoring
Small refactoring of
`go.etcd.io/etcd/etcdserver/api/etcdhttp/metrics.go.checkHealth`
function just to avoid anoying repeatings of `if h.Health == "true" {`
2020-03-17 15:37:11 +02:00
Rafael Fernández López
6991f619f2
etcdserver: fix quorum calculation when promoting a learner member
When promoting a learner member we should not count already a voting
member, but take only into account the number of existing voting
members and their current status (started, unstarted) when taking the
decision whether a learner member can be promoted.

Before this change, it was impossible to grow from a quorum N to a N+1
through promoting a learning member.

Fixes: #11633
2020-02-20 12:06:35 +01:00
Jingyi Hu
d6a3c995cf
Merge pull request #11621 from jingyih/corruption_check_tls
etcdserver: make corruption check work under peer mTLS
2020-02-18 18:55:13 +08:00
Ted Yu
7e0e6bf497 mvcc/backend: remove db.tmp regardless of logger presence 2020-02-14 12:10:24 -08:00
jingyih
c031b27491 etcdserver: corruption check via http
During corruption check, get peer's hashKV via http call.
2020-02-14 06:03:15 -08:00
Joe Betz
213f7f7877
mvcc/backend: Delete orphaned db.tmp files before defrag 2020-02-12 22:40:28 -08:00
Jingyi Hu
61f279454e
etcdserver/api: remove capnslog (#11606)
* etcdserver/api/rafthttp: remove capnslog

* etcdserver/api/membership: remove capnslog

* etcdserver/api/v2auth: remove capnslog

* etcdserver/api/v2discovery: remove capnslog

* etdserver/api/v2stats: remove capnslog

* etcdserver/api/v2http: remove capnslog

* etcdserver/api/v3rpc: remove capnslog

* etcdserver/api: remove capnslog

Remove capnslog from etcdserver/api. Note that capnslog was
already removed in some packages under etcdserver/api in
previous commits.
2020-02-11 13:51:25 -08:00
Sahdev Zala
4c25efc1f8
Discovery: do not allow passing negative cluster size (#11608)
When an etcd instance attempts to perform service discovery, if a
cluster size with negative value  is provided, the etcd instance
will panic without recovery because of
2020-02-10 10:43:41 -08:00
Daniel Lipovetsky
bc4adb8b5c
etcdserver: populate ResponseHeader in Alarm method (#11600)
When no Alarms are found, the response has no header. The header should always
be populated. Some components, like fields printer used by etcdctl, break when
the header is not populated.

Fixes #11581

Signed-off-by: Daniel Lipovetsky <dlipovetsky@d2iq.com>
2020-02-08 23:07:58 -08:00
Vern Burton
071e70cdc4
*: add a new API and command for checking auth status (#11536)
This changes have started at etcdctl under auth.go, and make changes to stub out everything down into the internal raft.  Made changes to the .proto files and regenerated them so that the local version would build successfully.
2020-02-05 19:27:42 -08:00
Lars Lehtonen
f2c3bcd086
etcdserver/api/v2v3: fix dropped test error
etcdserver/api/v2v3: use testing.T instead of log in tests
2020-02-05 07:20:12 -08:00
yoyinzyc
7784ca8997 etcdserver: remove v2 version set; e2e: fix tests. 2019-12-09 13:08:00 -08:00
Jingyi Hu
ed5a01a48d etcdserver: recover cluster version from backend 2019-12-05 16:25:13 -08:00
Jingyi Hu
dcd622b2c7 etcdserver: add v3 request type for cluster attr
Added ClusterVersionSetRequest for setting cluster version via v3 apply.

Added ClusterMemberAttrSetRequest for setting clsuter member attributes
via v3 apply.
2019-12-05 16:25:13 -08:00
yoyinzyc
80a177292e rafthttp: add test stream support for current version. 2019-10-21 09:45:00 -07:00
Jingyi Hu
5dc12f2725
Merge pull request #11274 from YoyinZyc/fix-upgrade-failure
rafthttp: add 3.4.0,3.5.0 stream type
2019-10-20 19:20:06 -07:00
yoyinzyc
a0e528e4b1 rafthttp: add 3.4.0,3.5.0 stream type 2019-10-17 14:25:56 -07:00