Commit Graph

2020 Commits (bc9e433ca26be0314a37c8c6ead66429a584bbc9)

Author SHA1 Message Date
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
Gyuho Lee 8af52dc0e7
Merge pull request #11935 from tangcong/save-cindex-for-lease
lease: ensure grant/revoke won't be applied repeatedly after restarting etcd
2020-05-31 00:56:12 -07:00
David Crawshaw 66cb045d47 etcdserver, et al: add --unsafe-no-fsync flag
This makes it possible to run an etcd node for testing and development
without placing lots of load on the file system.

Fixes #11930.

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2020-05-26 09:21:49 +10: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 4c9571d909
Merge pull request #11933 from needkane/PR
etcdserver: Missing the cfg.Logger causes panic
2020-05-22 09:23:27 -07:00
tangcong e9ae8eb5a1 *: ensure grant/revoke won't be applied repeatedly after restarting etcd 2020-05-22 21:47:24 +08:00
needkane c8ae694dea etcdserver: Missing the cfg.Logger causes panic 2020-05-22 03:42:44 -04: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 d230e6ba8c etcdserver: handle and apply downgrade validate, enable and cancel requests 2020-05-15 14:45:00 -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 b68eea236e etcdserver/*, wal/*:Add comments, clean up error messages and tests 2020-05-14 13:34:55 -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 50517039ae
etcdserver/*, wal/*: add Sync method 2020-05-13 08:47:47 -07:00
Viacheslav Biriukov 91efa67cb1
etcdserver/*: rollback default settings 2020-05-13 08:47:47 -07:00
Viacheslav Biriukov 5435e7686a
etcdserver/*: fix tests 2020-05-13 08:47:41 -07:00
Viacheslav Biriukov 3d2b565f98
etcdserver/*: changes to snapshots and wal logic to fix #10219 2020-05-13 08:46:15 -07:00
Viacheslav Biriukov 9162cd613d
etcdserver/*, wal/*: changes to snapshots and wal logic to fix #10219 2020-05-13 08:42:03 -07:00
Gyuho Lee ab494956bf
Merge pull request #11862 from gyuho/const
etcdserver: compute max request bytes humanized string once
2020-05-11 19:36:37 -07:00
Gyuho Lee d93c36bbb9 *: run "gofmt -s" on genproto complete
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-05-09 23:14:32 -07:00
Gyuho Lee 89a3a24d5a etcdserver: compute max request bytes humanized string once
No need to compute the request size limit everytime in runtime

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2020-05-09 23:11:45 -07:00
Hitoshi Mitake feb56298dd
etcdserver: don't let InternalAuthenticateRequest have password (#11818) 2020-05-06 16:46:41 -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
Gyuho Lee 0908a8bd10
Merge pull request #11725 from YoyinZyc/downgrade-api
[Etcd Downgrade] Store downgrade info to backend
2020-04-17 15:29:10 -07:00
tangcong 6c41190bc5 etcdserver: make recoverSnapshotBackend more robust 2020-04-17 09:30:22 +08:00
tangcong 3c85b67f7b etcdserver: remove redundant storage restore operation 2020-04-17 06:43:24 +08: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
Yuchen Zhou c623f798cb
etcdserver: add trace for txn request (#11491)
* etcdserver: add trace for txn request

* pkg/traceutil: added StopSubTrace as a sign of the end of subtrace. Added test case for logging out subtrace.
2020-04-04 14:46:03 -07:00
Sahdev Zala a04b74d4b4
Merge pull request #11639 from jingyih/linearizable_memberlist
*: serve member list API with linearizable guarantee
2020-03-27 11:13:58 -04: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 3ac7a11515
Merge pull request #11699 from tangcong/refactor-consistentindex
*: refactor consistentindex
2020-03-25 18:07:44 -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
tangcong 631c23d198 etcdserver/cindex: add unit test 2020-03-25 10:59:19 +08:00
tangcong 7b2018683a *: refactor consistent index 2020-03-25 10:59:15 +08: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
Jingyi Hu 193e60ebd9
Merge pull request #11670 from tangcong/optimize-auth-store-log
*: optimize auth/etcdserver logs to facilitate troubleshooting data inconsistency
2020-03-16 00:15:14 +08:00
tangcong 5a17367923 etcdserver: print warn log when failed to apply request 2020-03-10 23:13:53 +08:00
shawwang 15eeb2c4ae etcdserver: add auth revision to AuthStatus to improve observability and testability 2020-03-04 22:37:24 +08:00
tangcong 06ad53321e *: fix auth revision corruption bug 2020-02-29 13:31:37 +08: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
Jingyi Hu c94782cd55
etcdserver: remove capnslog (#11611)
remove capnslog from etcdserver pkg, except etcdserver/api.
2020-02-11 08:54:14 -08:00
Hitoshi Mitake fda8d38bd4 etcdserver: mark AuthStatus as no side effect request 2020-02-11 23:26:50 +09: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
Gyuho Lee a924600700
Merge pull request #11590 from alrs/fix-dropped-test-error
etcdserver/api/v2v3: fix dropped test error
2020-02-05 08:41:07 -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
Jingyi Hu 7395ed8e5d
Merge pull request #11578 from jingyih/set_zap_as_default_logger
*: set zap as default logger, remove capnslog
2020-02-04 22:58:45 -08:00
jingyih 725e09023a *: set zap as default logger, remove capnslog
Set zap as default logger. Remove capnslog and deprecated logging
flags.
2020-02-04 04:57:49 -08:00
sfzhu93 cad92706cf
in multiple packages: fixed goroutine leak bugs in tests (#11569) 2020-01-30 10:45:59 -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 5cd2502ab1 etcdserver: use v3 to publish member attr 2019-12-05 16:25:13 -08:00
yoyinzyc 0c3401fa76 etcdserver: use V3 to update cluster version 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
jianli cdc28507ef etcdserver: fix append object to a new allocated sized slice 2019-11-01 10:19:45 +08:00
Jingyi Hu c447955d93 etcdserver: wait purge file loop during shutdown
To prevent the purge file loop from accidentally acquiring the file lock
and remove the files during server shutdowm.
2019-10-30 14:21:08 -07:00
Hitoshi Mitake 84e2788c2e
Merge pull request #10468 from jingyih/remove_auth_loop
etcdserver: remove infinite loop for auth in raftRequest
2019-10-29 00:11:40 +09: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
Jingyi Hu 444bfdff59 etcdserver: strip patch version in metrics
Strip patch version in cluster version metrics during node restart.
2019-10-16 12:39:17 -07:00
Jingyi Hu 1333abc606 etcdserver: strip patch version in cluster version
Strip patch version in cluster version metrics.
2019-10-14 16:59:09 -07:00
Jingyi Hu 9c4194f6ef etcdserver: unset old cluster version in metrics 2019-10-11 22:25:03 -07:00
Gyuho Lee 340f0ac797
Merge pull request #11179 from YoyinZyc/trace
Add tracing to range request in etcd server.
2019-10-08 13:23:53 -07:00
yoyinzyc 57aa68af5a etcdserver: trace compaction request; add return parameter 'trace' to applierV3.Compaction()
mvcc: trace compaction request; add input parameter 'trace' to KV.Compact()
2019-10-07 09:55:27 -07:00
yoyinzyc 3a3eb24c69 etcdserver: trace raft requests. 2019-10-01 15:38:52 -07:00
yoyinzyc 401df4bb8e etcdserver: add put request steps.
mvcc: add put request steps; add trace to KV.Write() as input parameter.
2019-10-01 14:08:06 -07:00
yoyinzyc 1d6ef8370e pkg: use zap logger to format the structure log output. 2019-09-30 13:11:21 -07:00
yoyinzyc 3830b3ef11 pkg: add field to record additional detail of trace; add stepThreshold
to reduce log volume.
2019-09-30 13:11:21 -07:00
yoyinzyc f4e7fc56a7 pkg: create package traceutil for tracing. mvcc: add tracing
steps:range from the in-memory index tree; range from boltdb.
etcdserver: add tracing steps: agreement among raft nodes before
linerized reading; authentication; filter and sort kv pairs; assemble
the response.
2019-09-30 13:06:02 -07:00
Xiang Li 589ab747f7
Merge pull request #11014 from dbavatar/peervalidation
etcdserver: Fix PeerURL validation
2019-09-13 17:42:39 -07:00
Debabrata Banerjee 0dd10cf6b8 etcdserver: Fix PeerURL validation
In case of URLs that are synonyms, the current lexicographic sorting
and compare of the URLs fails with frustrating errors. Make sure to do
a full comparison between every set of PeerURLs before failing.

Fixes #11013
2019-09-13 17:53:40 -04:00
zhangjianweibj 81a34ab6d5 etcdserver: remove dup percentage sign in log 2019-09-05 11:24:39 +08:00