Commit Graph

451 Commits (b1da829844837b71c37546dda24ce7150b0e771f)

Author SHA1 Message Date
WizardCXY 7f9479acc1 clientv3: add member promote 2019-05-15 13:27:42 -07:00
WizardCXY ba9fd620e8 etcdserver: support MemberPromote for learner 2019-05-15 13:27:42 -07:00
Jingyi Hu 43ed94f769 etcdserver: filter rpc request to learner
Hardcoded allowed rpc for learner node. Added filtering in grpc
interceptor to check if rpc is allowed for learner node.
2019-05-15 13:15:20 -07:00
Jingyi Hu 355d0ab2a6 *: add learner field in endpoint status
Added learner field to endpoint status API.
2019-05-15 13:13:59 -07:00
Jingyi Hu e1acf244c1 etcdserver: Add MemberAddAsLearner
Made changes to api/membership:

- Added MemberAddAsLearner
- Reverted changes to MemberAdd - removed input parameter isLearner
2019-05-14 18:18:10 -07:00
Jingyi Hu 2b76200f70 *: add MemberAddAsLearner to clientv3 Cluster API
Made changes to Clientv3 Cluster API:

- Added MemberAddAsLearner.
- Reverted changes to MemberAdd - removed input parameter isLearner.
2019-05-14 16:56:44 -07:00
Jingyi Hu fc14608cb7 clientv3: support MemberAdd for learner
Added IsLearner flag to clientv3 MemberAdd API.
2019-05-14 13:10:22 -07:00
Jingyi Hu 604bc04f70 etcdserver: support MemberAdd for learner
Added IsLearner field to etcdserver internal Member type. Routed
learner MemberAdd request from server API to raft. Apply learner
MemberAdd result to server after the request is passed through Raft.
2019-05-14 13:10:22 -07:00
Jingyi Hu a0d3c4d641 *: fix compilation after API change
Fixed compilation erros after API change for learner.
2019-05-14 13:10:22 -07:00
shivaramr 9150bf52d6 go modules: Fix module path version to include version number 2019-04-26 15:29:50 -07:00
nolouch decc0d5f43 api/rafthttp: fix the probing status print
Signed-off-by: nolouch <nolouch@gmail.com>
2019-04-23 19:51:34 +08:00
Sam Batschelet 9915d02022 *: Change gRPC proxy to expose etcd server endpoint /metrics
This PR resolves an issue where the `/metrics` endpoints exposed by the proxy were not returning metrics of the etcd members servers but of the proxy itself.

Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2019-04-10 16:09:32 -04:00
Brandon Philips f17c038fc4 etcdserver: api/v2v3: add initial tests
Add a bunch of tests on fundamental operation of Create/Set/Delete.

Context: I want to use this package to run the discovery service against
the v3 storage backend. The limited functionality already implemented
should be sufficient to do this.
https://github.com/coreos/discovery.etcd.io/issues/52
2019-04-10 19:17:25 +00:00
johncming bd41f74168 etcdserver/api/rafthttp: fix the location of close http body. 2019-03-11 22:20:38 +08:00
zhoulin xie a943ad0ee4 client/keys_bench_test.go: Fix some misspells
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-02-28 14:36:06 -05:00
Sam Batschelet 577d7c0df2 e2e: update test to reflect (ST1005) update.
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2019-01-08 21:04:20 -05:00
Sam Batschelet a82703b69e *: error strings should not end with punctuation or a newline (ST1005)
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2019-01-08 21:04:20 -05:00
Xiang Li 6511829d1f
Merge pull request #10374 from johncming/deprecated
api/rafthttp: remove deprecated req.Cancel.
2019-01-08 14:33:25 -08:00
Gyuho Lee 442c863413
Merge pull request #10377 from johncming/cancel-pos
api/v2auth: remove defer in loop.
2019-01-08 09:43:06 -08:00
Xiang Li b04633fd8e
Merge pull request #10375 from johncming/redundant-parentheses
etcdserver: remove redundant parentheses.
2019-01-07 18:38:26 -08:00
caoming e96dbfb973 api/v2auth: remove defer in loop. 2019-01-08 08:56:55 +08:00
caoming 5060560f92 api/v2store: use camel case instead of snake case. 2019-01-07 10:35:23 +08:00
caoming 802e2aaadd etcdserver: remove redundant parentheses. 2019-01-07 10:27:52 +08:00
caoming 4651f49a5c api/rafthttp: remove deprecated req.Cancel. 2019-01-07 10:12:47 +08:00
caoming b2e0e760a0 etcdserver: add missing lg assignment. 2019-01-05 09:24:48 +08:00
lsytj0413 792aad932f refactor(*): fix golint warning 2018-12-24 11:43:10 +08:00
Gyuho Lee 291768af0f etcdserver/*: add "etcd_cluster_version" metric
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-11-13 21:49:12 -08:00
Shin'ya Ueoka aa4313a55a *: fix github links 2018-11-10 11:14:18 +09:00
Gyuho Lee d2a0f17b82
Merge pull request #10155 from gyuho/metrics-messages
rafthttp: probe all raft transports
2018-10-09 11:18:31 -07:00
Gyuho Lee 601d8b4677 etcdserver/api/etcdhttp: remove unused "HandleHealth" function
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-10-07 17:16:18 -07:00
Gyuho Lee 004e04a1d1 etcdserver/api/etcdhttp: add "etcd_server_health_success/failures"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-10-07 17:15:12 -07:00
Gyuho Lee 884a8bd36b etcdserver/api/rafthttp: configure "streamProber" in tests
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-10-07 03:32:05 -07:00
Gyuho Lee 7b1ef37054 etcdserver/api/rafthttp: probe all Raft messages' RTT
This PR adds another probing routine to monitor the connection
for Raft message transports. Previously, we only monitored
snapshot transports.

In our production cluster, we found one TCP connection had >8-sec
latencies to a remote peer, but "etcd_network_peer_round_trip_time_seconds"
metrics shows <1-sec latency distribution, which means etcd server
was not sampling enough while such latency spikes happen
outside of snapshot pipeline connection.

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-10-07 03:28:54 -07:00
Gyuho Lee 4a239070c8 etcdserver/api/rafthttp: display roundtripper name in warnings
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-10-07 03:14:42 -07:00
Gyuho Lee 47cff4dfe5 etcdserver/api/rafthttp: rename to "pipelineProber"
Preliminary work to add prober to "streamRt"

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-10-07 03:13:10 -07:00
nolouch 4de27039cb server: drop read request if found leader changed 2018-09-14 15:58:35 +08:00
Gyuho Lee 8560221091 etcdserver: fix gofmt warnings with Go 1.11
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 21:45:12 -07:00
Gyuho Lee 0ef9ef3c74 *: rerun "gofmt"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 18:25:39 -07:00
Gyuho Lee 1399bc69ce etcdserver: update import paths to "go.etcd.io/etcd"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 17:47:55 -07:00
Sam Batschelet af85949b41
Merge pull request #10024 from gyuho/became-inactive
etcdserver/api/rafthttp: clarify "became inactive" warning
2018-08-24 22:12:16 -04:00
Gyuho Lee 156ff6461d etcdserver/api/rafthttp: clarify "became inactive" warning
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-17 17:45:53 -07:00
Jingyi Hu 8d85259b56 etcdserver/api/v3rpc/interceptor: add log level checking
Check log level before generating and writing log info.
2018-08-17 16:12:05 -07:00
Gyuho Lee 6f4c509ad8 etcdserver/api/rafthttp: add v3 snapshot send/receive metrics
Distribution would be:
0.1 second or more
...
25.6 seconds or more
51.2 seconds or more

etcd_network_snapshot_send_success
etcd_network_snapshot_send_failures
etcd_network_snapshot_send_total_duration_seconds
etcd_network_snapshot_receive_success
etcd_network_snapshot_receive_failures
etcd_network_snapshot_receive_total_duration_seconds

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-15 12:56:50 -07:00
Gyuho Lee c392cd20cf etcdserver/api/snap: add v3 snapshot fsync metrics
etcd_snap_db_fsync_duration_seconds_count
etcd_snap_db_save_total_duration_seconds_bucket

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-15 12:56:44 -07:00
Jingyi Hu 368010d8a3 etcdserver: code clean up
Code clean up in interceptor.go
2018-08-10 16:29:42 -07:00
Jingyi Hu 30662940f4 vendor: add go-grpc-middleware
Rebased to master PR #9994.  Fixed a Go format issue in
v3rpc/interceptor.go.  Updated vendor to include go-grpc-middleware.
2018-08-10 13:15:35 -07:00
Jingyi Hu dc01734c6b etcdserver: add grpc interceptor to log info on incoming requests to
etcd server

To improve debuggability of etcd v3. Added a grpc interceptor to log
info on incoming requests to etcd server. The log output includes
remote client info, request content (with value field redacted), request
handling latency, response size, etc. Uses zap logger if available,
otherwise uses capnslog.

Also did some clean up on the chaining of grpc interceptors on server
side.
2018-08-10 11:01:07 -07:00
Iskander Sharipov d0f800c930 etcdserver/api/v2discovery: simplify !(x == y) to x != y
Found using https://go-critic.github.io/overview#boolExprSimplify-ref
2018-07-28 23:47:17 +03:00
Gyuho Lee 51af6a062f etcdserver: clean up code format
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-07-21 16:03:16 -07:00
Joe Betz 4b51b6de49
*: Add progress notify request watch request 2018-06-27 16:46:13 -07:00
Gyuho Lee 339cda03b3 etcdserver/api/v3rpc: remove duplicate gRPC logger set
Fix

=== RUN   TestEmbedEtcd
==================
WARNING: DATA RACE
Write at 0x000001df86d0 by goroutine 711:
  github.com/coreos/etcd/embed.(*Config).setupLogging.func1()
      /go/src/github.com/coreos/etcd/vendor/google.golang.org/grpc/grpclog/loggerv2.go:68 +0x16c
  sync.(*Once).Do()
      /usr/local/go/src/sync/once.go:44 +0xe1
  github.com/coreos/etcd/embed.(*Config).setupLogging()

in gRPC proxy tests.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-18 09:41:37 -07:00
Gyuho Lee 8990126c17 rafthttp: add "RaftDropHeartbeat" failpoint
To simulate network partition locally.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-15 13:10:58 -07:00
Gyuho Lee 3821f3364d etcdserver/api/rafthttp: add "etcd_network_active_peers/disconnected_peers_total"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-23 14:23:45 -07:00
Gyuho Lee afe78fbe69 etcdserver/api/v2http: document histogram
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-23 14:03:28 -07:00
Gyuho Lee 973fe43b83 etcdserver/api/snap: document histograms, add "etcd_snap_fsync_duration_seconds"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-23 14:03:28 -07:00
Gyuho Lee 640f5e64a9 etcdserver/api/rafthttp: document round-trip metrics, clean up
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-23 14:03:28 -07:00
Gyuho Lee 5a9e48be30 etcdserver/api/rafthttp: increase bucket upperbound up-to 3-sec
From 0.8 sec to 3.2 sec for more detailed latency analysis

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-23 14:03:28 -07:00
Gyuho Lee a5b32ba941 etcdserver/api/v3rpc: add "etcd_network_server_stream_failures_total"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-23 08:05:43 -07:00
Sam Batschelet 05554119c9 vendor: use latest "grpc-ecosystem/grpc-gateway" 2018-05-22 17:35:15 -04:00
Gyuho Lee 7940113906 *: move internal "etcdserver/api/rafthttp"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-21 10:31:16 -07:00
Gyuho Lee 2dd555c983 *: move "etcdserver/api/v3compactor"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-21 10:31:16 -07:00
Gyuho Lee 871c218894 *: move "etcdserver/api/v3alarm"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-21 10:31:16 -07:00
Gyuho Lee 9149565cb3 *: move to "etcdserver/api/membership"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-21 10:31:16 -07:00
Gyuho Lee 671f1c41a8 etcdserver/api/v2discovery: move internal "discovery" package
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-21 09:50:38 -07:00
Gyuho Lee 2bd689acea etcdserver/api/snap: rename internal package
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-21 07:45:34 -07:00
Gyuho Lee 4a4be9275c
Merge pull request #9681 from gyuho/config-log
doc: deprecate '/config/local/log' in v3.5
2018-05-15 11:07:07 -07:00
Gyuho Lee 7a92bbfed2 etcdserver/*: move internal v2 packages
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-14 12:49:49 -07:00
Gyuho Lee 294b5745d6 etcdserver/api/v3rpc: support watch fragmentation with max request bytes
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-14 12:35:50 -07:00
Gyuho Lee 7088d2bf52 etcdserver/api/v3rpc: clean up, read lock on "prevKV"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-14 12:35:50 -07:00
Gyuho Lee e1df2156c7 etcdserver/api/v3rpc: clean up godoc
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-14 12:35:50 -07:00
Gyuho Lee ba7cc04bac etcdserver/api/v2v3: fix "getDir" with "sorted"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-09 15:42:45 -07:00
Gyuho Lee 8235982f6e etcdserver/api/v2http: remove unused parameters
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-09 15:39:44 -07:00
Gyuho Lee 807770740a etcdserver/api: add TODO to deprecate '/config/local/log'
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-04 21:30:23 -07:00
Gyuho Lee c60054abea etcdserver/api/etcdhttp: use structured logging in peer handler
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-02 12:53:28 -07:00
Gyuho Lee cccf77db9e etcdserver/api/v2http: support structured logging
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-02 11:57:23 -07:00
Gyuho Lee 3b38cb305f etcdserver/api/etcdhttp: support structured logging
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-02 11:57:23 -07:00
Gyuho Lee 6cf3dae93e etcdserver/api/v3rpc: fix race in stream error logging
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-01 16:19:55 -07:00
Gyuho Lee eae30a6c9b etcdserver: fix "unconvert" warnings
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-30 15:32:16 -07:00
Iwasaki Yudai 3c25465855 etcdserver: Fix v2v3api set to create parent directly if not exists
When a new file is created under an non existent directly,
the v2 API automatically create the parent directly.
This commit aligns the behaviour of v2v3 emulation to comply with the v2
API.
2018-04-25 17:36:59 -07:00
Gyuho Lee bdbed26f64 etcdserver: support structured logging
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-16 17:36:00 -07:00
Hitoshi Mitake b0ed5c1dd8
Merge pull request #8680 from mitake/auth-cleanup
*: don't use a string literal directly in grpc metadata
2018-03-20 18:19:23 +09:00
Gyuho Lee 4cb0d167d6 v3rpc: clean up "maintenanceServer.Status" call
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-17 02:41:54 -07:00
Gyuho Lee 509cf414f7 etcdserver: remove duplicate "setAppliedIndex" calls
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-15 19:35:44 -04:00
Gyuho Lee 4f754c1850 etcdserver: clean up with "RaftStatusGetter"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-15 19:30:08 -04:00
Hitoshi Mitake b1dd19a7aa *: don't use string literals directly in grpc metadata
Current etcd code uses the string literals ("token", "authorization")
as field names of grpc and swappger metadata for passing token. It is
difficult to maintain so this commit introduces new constants for the
purpose.
2018-03-15 14:17:34 +09:00
Iwasaki Yudai db21941d1d *: enforce max lease TTL with 9,000,000,000 seconds
math.MaxInt64 / time.Second is 9,223,372,036. 9,000,000,000 is easier to
remember/document.
2018-03-08 10:17:12 -08:00
Gyuho Lee 85533a6305 api/v3election: error on missing "leader" field
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-01 16:16:45 -08:00
Gyuho Lee 811566f2f2 *: fix "v2store" imports
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee 33d8126c6b *: regenerate proto
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee d493cd3bbd etcdserver: fix proto import paths
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee 69f7e11506 *: move "error" to "etcdserver/v2error"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee 8a518b01c4 *: revert "internal/mvcc" change
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee 0e12e888e0 *: move "internal/store" to "etcdserver/v2store"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee dd2f3b0de8 *: revert "internal/lease" change
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee bb95d190c1 *: revert "internal/auth" change
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee 0850ccbf45 *: revert "internal/version" change
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Sam Batschelet fcd71b47d5
Merge pull request #9298 from hexfusion/v3
*: replace grpc-gateway endpoint with /v3
2018-02-13 17:17:57 -05:00
Gyuho Lee a9804cdf75 *: regenerate proto with typo fix "acquisition"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-12 09:25:26 -08:00
Sam Batschelet 488ee99ae8 *: replace grpc-gateway endpoint with stable /v3 2018-02-11 19:07:36 -05:00
Xiang 142bff89f4 v3rpc: add jitter to progress notification 2018-02-05 10:37:12 -08:00