14823 Commits

Author SHA1 Message Date
Xiang Li
8a9a2a1a5a
Merge pull request #10309 from tbg/fix/raft-status-allocs
raft: add (*RawNode).WithProgress
2018-12-06 10:56:40 -08:00
Tobias Schottdorf
bd332b318e raft: add (*RawNode).WithProgress
Calls to Status can be frequent and currently incur three heap
allocations, but often the caller has no intention to hold on to the
returned status.

Add StatusWithoutProgress and WithProgress to allow avoiding heap
allocations altogether. StatusWithoutProgress does what's on the
tin and additionally returns a value (instead of a pointer) to
avoid the associated heap allocation. By not returning a Progress
map, it avoids all other allocations that Status incurs.

To still introspect the Progress map, add WithProgress, which
uses a simple visitor pattern.

Add benchmarks to verify that this is indeed allocation free.

```
BenchmarkStatusProgress/members=1/Status-8                  5000000    353 ns/op        784 B/op    3 allocs/op
BenchmarkStatusProgress/members=1/Status-example-8          5000000    372 ns/op        784 B/op    3 allocs/op
BenchmarkStatusProgress/members=1/StatusWithoutProgress-8   100000000  17.6 ns/op         0 B/op    0 allocs/op
BenchmarkStatusProgress/members=1/WithProgress-8            30000000   48.6 ns/op         0 B/op    0 allocs/op
BenchmarkStatusProgress/members=1/WithProgress-example-8    30000000   42.9 ns/op         0 B/op    0 allocs/op
BenchmarkStatusProgress/members=3/Status-8                  5000000    395 ns/op        784 B/op    3 allocs/op
BenchmarkStatusProgress/members=3/Status-example-8          3000000    449 ns/op        784 B/op    3 allocs/op
BenchmarkStatusProgress/members=3/StatusWithoutProgress-8   100000000  18.7 ns/op         0 B/op    0 allocs/op
BenchmarkStatusProgress/members=3/WithProgress-8            20000000   78.1 ns/op         0 B/op    0 allocs/op
BenchmarkStatusProgress/members=3/WithProgress-example-8    20000000   70.7 ns/op         0 B/op    0 allocs/op
BenchmarkStatusProgress/members=5/Status-8                  3000000    470 ns/op        784 B/op    3 allocs/op
BenchmarkStatusProgress/members=5/Status-example-8          3000000    544 ns/op        784 B/op    3 allocs/op
BenchmarkStatusProgress/members=5/StatusWithoutProgress-8   100000000  19.7 ns/op         0 B/op    0 allocs/op
BenchmarkStatusProgress/members=5/WithProgress-8            20000000   105 ns/op          0 B/op    0 allocs/op
BenchmarkStatusProgress/members=5/WithProgress-example-8    20000000   94.0 ns/op         0 B/op    0 allocs/op
BenchmarkStatusProgress/members=100/Status-8                100000     11903 ns/op    22663 B/op   12 allocs/op
BenchmarkStatusProgress/members=100/Status-example-8        100000     13330 ns/op    22669 B/op   12 allocs/op
BenchmarkStatusProgress/members=100/StatusWithoutProgress-8 50000000   20.9 ns/op         0 B/op    0 allocs/op
BenchmarkStatusProgress/members=100/WithProgress-8          1000000    1731 ns/op         0 B/op    0 allocs/op
BenchmarkStatusProgress/members=100/WithProgress-example-8  1000000    1571 ns/op         0 B/op    0 allocs/op
```
2018-12-06 19:02:48 +01:00
Gyuho Lee
bfa2c15c55
Merge pull request #10307 from gyuho/update-image
docs/img: clarify "network partition + membership reconfiguration"
2018-12-06 09:28:36 -08:00
Gyuho Lee
0b5a3d8080 docs/img: clarify "network partition + membership reconfiguration"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-12-05 19:05:26 -08:00
Gyuho Lee
510ae3d2a2 clientv3/concurrency: fix govet errors
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-12-05 18:28:13 -08:00
Gyuho Lee
12b19ff5ea
Merge pull request #10306 from johncming/zap_logger
embed: set log-outputs 'default' to 'stderr' config when zap mode
2018-12-05 18:25:43 -08:00
caoming
6744c57de3 embed: set log-outputs 'default' to 'stderr' config when zap mode 2018-12-06 09:33:51 +08:00
Gyuho Lee
1124ccf4f9
Merge pull request #10305 from johncming/doc
Documentation/op-guide: fix typo.
2018-12-05 16:55:15 -08:00
caoming
e4ac8db4ae Documentation/op-guide: fix typo. 2018-12-06 08:48:30 +08:00
Xiang Li
83696d95c9
Merge pull request #10297 from thrawn01/election-resume
concurrency: set keyPrefix when calling ResumeElection()
2018-12-05 13:25:39 -08:00
Derrick J. Wippler
7d7266d3c9 concurrency: set keyPrefix when calling ResumeElection()
This change allows users to use Observe() after resuming an election as
Observe() requires a valid keyPrefix to function properly.
2018-12-05 14:50:56 -06:00
Xiang Li
3f01426712
Merge pull request #10301 from jingyih/add_timeout_to_etcdctl_snapshot_save
etcdctl: add timeout to snapshot save command
2018-12-04 21:23:15 -08:00
Xiang Li
ce3e127d0b
Merge pull request #10302 from jingyih/update_changelog_3p4_from_pr10301
CHANGELOG-3.4: update from #10301
2018-12-04 21:19:50 -08:00
Jingyi Hu
9db21117d1 CHANGELOG-3.4: update from #10301 2018-12-04 21:06:46 -08:00
Jingyi Hu
5b6b03d081 etcdctl: add timeout to snapshot save command
snapshot save command by default has no timeout, but respects user
specified command timeout.
2018-12-04 20:36:48 -08:00
Gyuho Lee
7f450bf696
Merge pull request #10296 from gyuho/learner
docs: rename to "learner" (from "non-voting member")
2018-12-03 11:17:26 -08:00
Gyuho Lee
bfd9596352 docs: rename to "learner" (from "non-voting member")
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-12-03 10:38:40 -08:00
Gyuho Lee
99c933b7bc
Merge pull request #10295 from gyuho/non-voting-member-design
docs: add "Non-voting member" design doc
2018-12-03 10:27:24 -08:00
Gyuho Lee
1f559736ef docs: add authors to client architecture doc
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-12-03 09:12:51 -08:00
Gyuho Lee
285a3acda6 docs: add "Non-voting member" design doc
By gyuho and jpbetz.

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-12-03 09:00:08 -08:00
Gyuho Lee
dedae6eb7c CHANGELOG-3.4: add backend batch limit/interval fields
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-11-28 14:03:05 -08:00
Xiang Li
829c9b2129
Merge pull request #10283 from xiang90/more_flags
*: add flags to setup backend related config
2018-11-27 18:58:43 -08:00
Xiang Li
3faed211e5 *: add flags to setup backend related config 2018-11-26 15:50:26 -08:00
Xiang Li
6c649de36e
Merge pull request #10281 from tbg/print-hint-reject-app-resp
raft: print RejectHint of zero on MsgAppResp
2018-11-24 11:48:16 +08:00
Xiang Li
f28945ba8a
Merge pull request #10279 from tbg/leader-progress-replicate
raft: ensure leader is in ProgressStateReplicate
2018-11-24 10:43:01 +08:00
Tobias Schottdorf
5c209d66d2 raft: ensure leader is in ProgressStateReplicate
The leader perpetually kept itself in ProgressStateProbe even though of
course it has perfect knowledge of its log. This wasn't usually an issue
because it also doesn't care about its own Progress, but it's better to
keep this data correctly maintained, especially since this is part of
raft.Status and thus becomes visible to applications using the Raft
library.

(Concretely, in CockroachDB we use the Progress to inform log
truncations).
2018-11-23 17:57:36 +01:00
Tobias Schottdorf
1569f4829d raft: print RejectHint of zero on MsgAppResp
A zero RejectHint on MsgAppResp is still used, and so should be
reflected in the message description.
2018-11-23 11:06:38 +01:00
Sam Batschelet
02a9810a9e
Merge pull request #10275 from hexfusion/maint
MAINTAINERS: add Sam Batschelet
2018-11-20 17:38:29 -05:00
Sam Batschelet
b4d200174e
Merge pull request #10278 from cwdsuzhou/master
Documentation: add ENV variable ETCD_CIPHER_SUITES description
2018-11-20 10:57:51 -05:00
caiweidong
a8293e5815 Documentation: add ENV variable ETCD_CIPHER_SUITES description
Fixes #10277
2018-11-20 22:40:24 +08:00
Sam Batschelet
0e8981d2ff
MAINTAINERS: add Sam Batschelet
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2018-11-19 19:43:15 -05:00
Gyuho Lee
bb25891960
Merge pull request #10268 from gyuho/dump-db
tools/etcd-dump-db: add "--timeout" flag
2018-11-15 23:16:24 -08:00
Gyuho Lee
f8a513ce65 tools/etcd-dump-db: add "--timeout" flag
By default, wait up to 10 seconds to obtain flocks.

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-11-15 22:50:32 -08:00
Gyuho Lee
af893d3549 CHANGELOG-3.4: add "etcd_cluster_version"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-11-15 08:17:57 -08:00
Xiang Li
024f3dfc82
Merge pull request #10257 from gyuho/cluster-version
etcdserver/*: add "etcd_cluster_version" metric
2018-11-15 22:02:57 +08:00
Xiang Li
322339bb54
Merge pull request #10262 from johncming/tcpproxy
tcpproxy: add a test.
2018-11-15 22:02:05 +08:00
Xiang Li
c2d023ce74
Merge pull request #10263 from johncming/raftstorage
raft:  add a test case in TestStorageAppend
2018-11-15 22:01:06 +08:00
Xiang Li
fa92397e18
Merge pull request #10258 from ajwerner/ajwerner/raft_committed_entries_size
raft: separate MaxCommittedSizePerReady config from MaxSizePerMsg
2018-11-15 22:00:00 +08:00
caoming
9668536124 raft: add a test case in TestStorageAppend 2018-11-15 16:41:36 +08:00
caoming
92cb9c3295 tcpproxy: add a test. 2018-11-15 14:28:30 +08:00
Andrew Werner
e4af2be5bb raft: separate MaxCommittedSizePerReady config from MaxSizePerMsg
Prior to this change, MaxSizePerMsg was used both to cap the total byte size of
entries in messages as well as the total byte size of entries passed through
CommittedEntries in the Ready struct. This change adds a new Config parameter
MaxCommittedSizePerReady which defaults to MaxSizePerMsg and contols the second
of above descibed settings.
2018-11-14 09:59:09 -05:00
Gyuho Lee
0226481584 tests/e2e: test cluster version
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-11-13 21:49:33 -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
Gyuho Lee
ee9dcbca0d
Merge pull request #10256 from philippgille/patch-1
Fix spelling in comment
2018-11-12 14:07:05 -08:00
Philipp Gillé
0cfc01b873 clientv3: Fix spelling in comment 2018-11-12 22:33:48 +01:00
Gyuho Lee
ae25c5e132
Merge pull request #10253 from mas9612/improve-docs
*: fix some typo and repo name
2018-11-11 11:41:57 -08:00
mas9612
9ee41f699c doc: fix typo in documentation 2018-11-11 23:27:04 +09:00
mas9612
963d76fc4c CONTRIBUTING: fix repo name 2018-11-11 23:25:53 +09:00
Gyuho Lee
e34423b6ff
Merge pull request #10251 from ueokande/fix-github-links
Fix github links
2018-11-09 18:28:42 -08:00
Shin'ya Ueoka
aa4313a55a *: fix github links 2018-11-10 11:14:18 +09:00