91 Commits

Author SHA1 Message Date
Barak Michener
192f200d9e Fix up migration tool, add snapshot migration
Fixes all updates since bcwaldon sketched the original, with cleanup and
into an acutal working state. The commit log follows:

fix pb reference and remove unused file post rebase

unbreak the migrate folder

correctly detect node IDs

fix snapshotting

Fix previous broken snapshot

Add raft log entries to the translation; fix test for all timezones. (Still in progress, but passing)

Fix etcd:join and etcd:remove

print more data when dumping the log

Cleanup based on yichengq's comments

more comments

Fix the commited index based on the snapshot, if one exists

detect nodeIDs from snapshot

add initial tool documentation and match the semantics in the build script and main

formalize migration doc

rename function and clarify docs

fix nil pointer

fix the record conversion test

add migration to test suite and fix govet
2014-11-14 16:46:08 -05:00
Ben Darnell
b29c512f50 Merge remote-tracking branch 'coreos/master' into log-storage-interface
* coreos/master: (27 commits)
  pkg/wait: move wait to pkg/wait
  etcdserver: do not add/remove/update local member to/from sender hub
  etcdserver: not record attributes when add member
  raft: add a test for proposeConfChange
  raft: block Stop() on n.done, support idempotency
  raft: add a test for node proposal
  integration: add increase cluster size test
  integration: remove unnecessary t.Testing argument
  raft: stop the node synchronously
  integration: fix test to propagate NewServer errors
  etcdserver: move peer URLs check to config
  etcdserver: ensure initial-advertise-peer-urls match initial-cluster
  raft: add a test for node.Tick
  raft: add comment string for TestNodeStart
  etcdserver: use member instead of node at etcd level
  raft: nodes return sorted ids
  raft: update unstable when calling stableTo with 0
  *: support updating advertise-peer-url Users might want to update the peerurl of the etcd member in several cases. For example, if the IP address of the physical machine etcd running on is changed, user need to update the adversite-pee-rurl accordingly. This commit makes etcd support updating the advertise-peer-url of its members.
  transport: create a tls listener only if the tlsInfo is not empty and the scheme is HTTPS
  etcdserver: use member pointer for all tests
  ...

Conflicts:
	etcdserver/server.go
	raft/log.go
	raft/log_test.go
	raft/node.go
2014-11-13 14:21:09 -05:00
Xiang Li
0d18a0f381 pkg/wait: move wait to pkg/wait 2014-11-13 09:11:53 -08:00
Ben Darnell
25b6590547 raft: introduce log storage interface.
This change splits the raftLog.entries array into an in-memory
"unstable" list and a pluggable interface for retrieving entries that
have been persisted to disk. An in-memory implementation of this
interface is provided which behaves the same as the old version;
in a future commit etcdserver could replace the MemoryStorage with
one backed by the WAL.
2014-11-10 17:40:39 -05:00
Brandon Philips
bdd2a0a018 test: add error package 2014-11-05 13:31:42 -08:00
Jonathan Boulle
55c92ad456 *: create ID type
This creates a simple ID type (wrapped around uint64) to provide for
standard serialization/deserialization to a string (i.e. base 16
encoded). This replaces strutil so now that package is removed.
2014-10-31 10:34:07 -07:00
Jonathan Boulle
cf9dd31daa etcd: move main logic to etcdmain subpackage 2014-10-29 18:43:22 -07:00
Brian Waldon
480e92d340 strutil: move IDAsHex/IDFromHex to new pkg 2014-10-27 18:39:09 -07:00
Brian Waldon
54a2d8ffc9 client: move Member models to new types pkg 2014-10-27 11:22:46 -07:00
Jonathan Boulle
6e6d1897d8 pkg: move everything into subpackages 2014-10-27 09:57:28 -07:00
Brian Waldon
29ef918808 etcdctl: import from external repo 2014-10-22 17:52:40 -07:00
Jonathan Boulle
341c7190d3 test: add govet to tests 2014-10-21 11:32:38 -07:00
Jonathan Boulle
ae4403c945 test: add discovery to tests 2014-10-21 00:17:14 -07:00
Yicheng Qin
1b7947357f *: pkg functional -> integration 2014-10-20 14:43:21 -07:00
Yicheng Qin
058537f34a main: add basic functional test 2014-10-20 14:43:21 -07:00
Brandon Philips
78a9bba276 pkg/types/flags: introduce flags package
I want to use the Addrs type in another experimental proxy that I am
implementing. Pull it out into a separate package.
2014-09-28 14:56:30 -07:00
Xiang Li
f393b1459a functional: remove functional 2014-09-25 11:34:39 -07:00
Xiang Li
a0f5625728 pkg: move /transport to pkg/transport 2014-09-25 10:47:14 -07:00
Brian Waldon
4a65813a66 test: alphabetize list of testable packages 2014-09-24 16:37:46 -07:00
Brian Waldon
e30c1eeefd pkg: move SetFlagsFromEnv to pkg package 2014-09-24 16:29:47 -07:00
Brian Waldon
314c13a8f0 pkg: move DeprecatedFlag to new package 2014-09-24 16:09:37 -07:00
Brian Waldon
17459c7bfc transport: wrap net.Listener with TLSInfo 2014-09-22 17:58:30 -07:00
Brandon Philips
fd48f3f2a4 test: stop running gofmt ./
gofmt ./ will recursively check the .git directory. So use *.go for
gofmt instead
2014-09-22 17:28:31 -07:00
Brian Waldon
49cc76d33b client: min client for discovery 2014-09-21 10:29:52 -07:00
Brian Waldon
fcf50e756d test: actually test main pkg 2014-09-18 11:01:00 -07:00
Xiang Li
79b8153eac test: test with race by default 2014-09-14 13:08:14 -07:00
Xiang Li
9bd9d88a9d test: sort the pkgs 2014-09-11 12:48:18 -07:00
Xiang Li
0feb153034 test: test wait pkg 2014-09-11 12:38:43 -07:00
Brian Waldon
e5a482266f proxy: introduce director
The director class drives an httputil.ReverseProxy. This is used when
etcd is deployed in proxy mode.
2014-09-10 18:04:03 -07:00
Brandon Philips
e5cc58c179 Merge pull request #1032 from jonboulle/fix_tests
scripts: use bash for build script
2014-09-09 14:21:51 -07:00
Jonathan Boulle
800de8e3bf scripts: use bash for build script 2014-09-09 11:34:55 -07:00
Jonathan Boulle
07ce8bc4bc etcdserver: split out functional test to new package 2014-09-09 11:18:24 -07:00
Jonathan Boulle
491362f5db scripts: add build, cover and update test
This adds a build script that attempts to be as user friendly as
possible: if they have already set $GOPATH and/or $GOBIN, use those
environment variables. If not, create a gopath for them in this
directory. This should facilitate both `go get` and `git clone` usage.

The `test` script is updated, and the new `cover` script facilitates
easy coverage generation for the repo's constituent packages by setting
the PKG environment variable.
2014-09-08 23:09:49 -07:00
Brandon Philips
91c52630b6 test: introduce test script
Why do this? `go test ./...` has a ton of annoying output:

```
?   	github.com/coreos/etcd	[no test files]
?   	github.com/coreos/etcd/crc	[no test files]
?   	github.com/coreos/etcd/elog	[no test files]
?   	github.com/coreos/etcd/error	[no test files]
ok  	github.com/coreos/etcd/etcdserver	0.267s
ok  	github.com/coreos/etcd/etcdserver/etcdhttp	0.022s
?   	github.com/coreos/etcd/etcdserver/etcdserverpb	[no test files]
ok  	github.com/coreos/etcd/raft	0.157s
?   	github.com/coreos/etcd/raft/raftpb	[no test files]
ok  	github.com/coreos/etcd/snap	0.018s
?   	github.com/coreos/etcd/snap/snappb	[no test files]
third_party/code.google.com/p/gogoprotobuf/proto/testdata/test.pb.go🔢
undefined: __emptyarchive__.Extension
ok  	github.com/coreos/etcd/store	4.247s
ok
github.com/coreos/etcd/third_party/code.google.com/p/go.net/context
2.724s
FAIL
github.com/coreos/etcd/third_party/code.google.com/p/gogoprotobuf/proto
[build failed]
ok
github.com/coreos/etcd/third_party/github.com/stretchr/testify/assert
0.013s
ok  	github.com/coreos/etcd/wait	0.010s
ok  	github.com/coreos/etcd/wal	0.024s
?   	github.com/coreos/etcd/wal/walpb	[no test files]
```

And we have no had to manually configure drone.io which I want to avoid:
https://drone.io/github.com/coreos/etcd/admin
2014-09-08 16:18:10 -07:00
Ben Johnson
fb7a91739a Remove functional tests. 2013-10-14 14:20:50 -06:00
Ben Johnson
63e128670e Fix etcd.NewClient(). 2013-10-14 09:55:57 -06:00
Xiang Li
1527b7008c fix test 2013-08-17 21:21:18 -07:00
Xiang Li
5bd24d8271 wait for exit and release resource 2013-08-17 08:30:32 -07:00
Xiang Li
177854c3e1 add test package. do not compile test codes with etcd 2013-08-17 08:30:31 -07:00
Brandon Philips
436e2a857f fix(test): update this to use build
use all of the same packages as the build script
2013-08-06 17:20:58 -07:00
Xiang Li
8ad7a23648 init test suit for etcd 2013-07-29 15:57:37 -07:00