6819 Commits

Author SHA1 Message Date
Gyu-Ho Lee
78b0b8a4a0 storage: range all unsynced at once
This is for https://github.com/coreos/etcd/issues/3848.
It replaces RangeHistory method for more efficient event
sending.
2015-12-28 11:37:26 -08:00
Anthony Romano
570687a509 Merge pull request #4081 from heyitsanthony/benchmark-multi-ep
tools/benchmark: support connecting to several endpoints
2015-12-28 10:31:35 -08:00
Anthony Romano
8e728afa62 tools/benchmark: support connecting to several endpoints
--endpoints is comma separated but gRPC blocks forever on comma
separated lists. Instead, round-robin select endpoints when
creating new connections.
2015-12-28 10:22:33 -08:00
Xiang Li
d07a9cd893 Merge pull request #4059 from xiang90/snap_log
rafthttp: better snapshot sending logging
2015-12-28 10:05:35 -08:00
Gyu-Ho Lee
466b33445f Merge pull request #4079 from gyuho/store_shadow
store: fix govet shadow on expiration variable
2015-12-28 11:03:57 -07:00
Gyu-Ho Lee
b072f0b048 store: fix expiration var shadowing, change test function names
Found at https://travis-ci.org/coreos/etcd/jobs/99087279#L298.
And changes test function names to make them clear.
2015-12-28 08:50:34 -08:00
Xiang Li
aec356e416 Merge pull request #4064 from xiang90/reduce_fysnc
backend: do not commit unless there is a pending change
2015-12-28 07:31:50 -08:00
Jonathan Boulle
1238187b72 Merge pull request #4078 from jonboulle/master
docs: clarify CAS/CAD do not work on directories
2015-12-27 22:35:51 +01:00
Jonathan Boulle
216c6674ed docs: clarify CAS/CAD do not work on directories
As noted in #4075. There are numerous style issues with this document
but I don't want to go down that rabbit hole so this is an attempt at a
minimally invasive clarification.
2015-12-27 22:35:08 +01:00
Gyu-Ho Lee
729b530c48 Merge pull request #4071 from gyuho/store_event_node
store: clean up event.go, node.go and add tests
2015-12-25 21:42:50 -07:00
Gyu-Ho Lee
64e182c69e store: clean up event.go, node.go and add tests
Updates IsCreated logic on event.go. Cleans up node.go
and adds tests to it.
2015-12-25 13:25:12 -08:00
Jonathan Boulle
70bcde89bc Merge pull request #4073 from gyuho/remove_seed
storage: remove unnecessary math/rand seed
2015-12-25 19:14:35 +01:00
Gyu-Ho Lee
df0c2e6842 storage: remove unnecessary math/rand seed
As @jonboulle pointed out at
https://github.com/coreos/etcd/pull/4070/files#r48441847:

> math/rand is unrelated to crypto/rand; the latter reads from /dev/urandom and
> is relying on the kernel's PRNG. Just remove the seed entirely.
2015-12-25 09:55:11 -08:00
Jonathan Boulle
dac56faf61 Merge pull request #4030 from mitake/endpoint-selection
client: add a mechanism for various endpoint selection mode
2015-12-24 12:55:16 +01:00
Jonathan Boulle
ff319add53 Merge pull request #4066 from gyuho/tip_shadow
pkg/fileutil: fix error var shadow
2015-12-24 10:24:27 +01:00
Gyu-Ho Lee
8d368c4dba pkg/fileutil: fix error var shadow
Go tip complains about error variable shadowing at
https://travis-ci.org/coreos/etcd/jobs/98636879#L291-L292.
2015-12-23 23:56:26 -08:00
Xiang Li
22b3b3e07a Merge pull request #4038 from AkihiroSuda/etcd-4007
pkg/fileutil: skip TestIsDirWriteable when running as root
2015-12-23 22:23:57 -08:00
Akihiro Suda
058f1449d6 pkg/fileutil: skip TestIsDirWriteable when running as root 2015-12-24 14:52:40 +09:00
Xiang Li
8bc59b66d1 backend: do not commit unless there is a pending change
Reduce the nubmer of fsync etcd issues when the cluster is
idle.
2015-12-23 18:58:37 -08:00
Hitoshi Mitake
a46ffc60e5 client: add a mechanism for various endpoint selection mode
Current etcd client library chooses a default destination node from
every member of a cluster in a random manner. However, requests of
write and read (for consistent results) need to be forwarded to the
leader node as the nature of Raft algorithm. If the chosen node is a
follower, additional network traffic will be caused by the forwarding
from follower to leader.

Mainly for reducing the forward traffic, this commit adds a new
mechanism for various endpoint selection mode to the client library
which can be configured with client.Config.SelectionMode.

Currently, two modes are provided:
 - EndpointSelectionRandom: default, same to existing behavior (pick
   a node in a random manner)
 - EndpointSelectionPrioritizeLeader: prioritize leader, for the above
   purpose

I evaluated the effectiveness of the EndpointSelectionPrioritizeLeader
with 4 t1.micro instances of AWS (3 nodes for etcd cluster and 1 node
for etcd client). Client executes this simple benchmark
(https://github.com/mitake/etcd-things/tree/master/prioritize-leader-bench),
just writes 10000 keys. When SelectionMode == EndpointSelectionRandom
(default), the benchmark needed 1 min and 32.102 sec to finish. When
SelectionMode == EndpointSelectionPrioritizeLeader, the benchmark
needed 1 min 4.760 sec.
2015-12-24 11:02:40 +09:00
Xiang Li
72e115ee6e Merge pull request #4062 from xiang90/fix_snap
*: fix snapshot sending cycle
2015-12-23 17:10:10 -08:00
Anthony Romano
3c17e45bcb Merge pull request #4063 from heyitsanthony/fix-shouldstop
etcdserver: stop if removed along with multiple conf changes
2015-12-23 16:46:18 -08:00
Anthony Romano
d7ad721ede etcdserver: stop if removed along with multiple conf changes
shouldstop would get clobbered when several conf changes are in an apply
2015-12-23 16:29:21 -08:00
Xiang Li
4be152bb4f rework 2015-12-23 16:21:16 -08:00
Xiang Li
9a51d40940 fix comment 2015-12-23 14:10:39 -08:00
Xiang Li
ab31ba0d29 *: fix snapshot sending cycle 2015-12-23 13:58:57 -08:00
Xiang Li
74dba2d4cf rafthttp: better snapshot sending logging
snapshot sending is an important event. We should always log it explicitly.
2015-12-23 12:36:07 -08:00
Anthony Romano
7e5b7cfc65 Merge pull request #4056 from heyitsanthony/benchmark-less-mem
tools/benchmark: stream results into reports
2015-12-23 11:51:13 -08:00
Anthony Romano
0c640d781c Merge pull request #4047 from heyitsanthony/test-activate-raftexample
test: activate tests on contrib/raftexample
2015-12-23 11:28:50 -08:00
Anthony Romano
382103af60 tools/benchmark: stream results into reports
Reports depended on writing all results to a large buffered channel and
reading from that synchronously. Similarly, requests were buffered the
same way which can take significant memory on big request strings. Instead,
have reports stream in results as they're produced then print when the
results channel closes.
2015-12-23 11:24:35 -08:00
Anthony Romano
58ac6aeb5a test: activate tests on contrib/raftexample
adds contrib/raftexample to integration tests and fixes two test races
2015-12-23 11:13:37 -08:00
Xiang Li
3f81f020c1 Merge pull request #4050 from xiang90/fsync
snap: call fsync before close db file
2015-12-23 09:42:13 -08:00
Jonathan Boulle
45de4e918e Merge pull request #3935 from dgonyeo/master
scripts: rewrote build-aci to use acbuild
2015-12-23 18:37:38 +01:00
Jonathan Boulle
834c2cf7cf Merge pull request #4054 from jonboulle/master
raft: small typo fixes in raft package doc
2015-12-23 18:19:47 +01:00
Xiang Li
b4c4146d6b Merge pull request #4051 from xiang90/log
rafthttp: log before receiving snapshot
2015-12-23 08:57:28 -08:00
Xiang Li
94da4b9ee5 rafthttp: log before receiving snapshot
Database snapshot can be as large as 5GB. It is reasonable
to log before receiving it. Or the user might not know what
is happening and why etcd starts to use IO intensively.
2015-12-23 08:45:36 -08:00
Jonathan Boulle
5c65c393a5 raft: small typo fixes in raft package doc 2015-12-23 16:37:06 +01:00
Hitoshi Mitake
53be8405f3 client: a new API for obtaining a leader node information 2015-12-23 22:54:04 +09:00
Xiang Li
191c5ef9cb snap: call fsync before close db file 2015-12-22 22:43:05 -08:00
Xiang Li
289de69632 Merge pull request #4048 from xiang90/util
etcdserver: move unti out of server.go
2015-12-22 15:41:39 -08:00
Xiang Li
d6d12b4d86 etcdserver: move unti out of server.go
etcdserver file is messy enough. Let's make it be less messy.
2015-12-22 15:17:14 -08:00
Xiang Li
59998dbc50 Merge pull request #3882 from colhom/etcd2-backup
contrib/systemd: etcd2-backup package and docs
2015-12-22 15:08:54 -08:00
Anthony Romano
c147da94a2 Merge pull request #4041 from heyitsanthony/v3-snapshot-low-latency
low latency V3 snapshot recovery
2015-12-22 15:03:35 -08:00
Colin Hom
85cd4d9647 contrib/systemd: etcd2-backup package and docs
multi-node backup and restore procedures for etcd2 clusters, presented as systemd jobs.
2015-12-22 14:52:10 -08:00
Anthony Romano
aca0c466ed etcdserver: asynchronously notify applier when raft writes finish
The raft loop would block on the applier's done channel after
persisting the raft messages; the latency could cause dropped network
messages. Instead, asynchronously notify the applier with a buffered
channel when the raft writes complete.
2015-12-22 14:15:14 -08:00
Anthony Romano
9d05a0d959 etcdserver: apply v3 database updates outside server event loop
raft's applyc writes block on the server loop's database IO since
the next applyc read must wait on the db operation to finish.
Instead, stream applyc to a run queue outside the server loop.
2015-12-22 14:15:09 -08:00
Anthony Romano
23d645babd Merge pull request #4046 from heyitsanthony/etcdserver-server-select-refactor
etcdserver: refactor server.go select loop
2015-12-22 12:29:10 -08:00
Anthony Romano
7e00325fe9 etcdserver: refactor server.go select loop
splits out the apply case into smaller functions
2015-12-22 12:13:39 -08:00
Xiang Li
79fa03081c Merge pull request #4045 from philips/add-raftexample-to-raft-docs
raft: add raftexample to the docs
2015-12-22 12:06:23 -08:00
Brandon Philips
c72e4ae112 raft: add raftexample to the docs
To help people wanting use this package get started point to the
raftexample package.
2015-12-22 12:04:39 -08:00