Commit Graph

104 Commits (819f5cf32fd6918a2a1b06d6bce58ce7aeb91c48)

Author SHA1 Message Date
Gyuho Lee 1caaa9ed4a test: test update for Go 1.12.5 and related changes
Update to Go 1.12.5 testing. Remove deprecated unused and gosimple
pacakges, and mask staticcheck 1006. Also, fix unconvert errors related
to unnecessary type conversions and following staticcheck errors:
- remove redundant return statements
- use for range instead of for select
- use time.Since instead of time.Now().Sub
- omit comparison to bool constant
- replace T.Fatal and T.Fatalf in tests with T.Error and T.Fatalf respectively because the goroutine calls T.Fatal must be called in the same goroutine as the test
- fix error strings that should not be capitalized
- use sort.Strings(...) instead of sort.Sort(sort.StringSlice(...))
- use he status code of Canceled instead of grpc.ErrClientConnClosing which is deprecated
- use use status.Errorf instead of grpc.Errorf which is deprecated

Related #10528 #10438
2019-06-05 17:02:05 -04:00
Gyuho Lee 34bd797e67 *: revert module import paths
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-05-28 15:39:35 -07:00
shivaramr 9150bf52d6 go modules: Fix module path version to include version number 2019-04-26 15:29:50 -07:00
Xiang Li d5e94b1c0d
Merge pull request #10557 from johncming/add_test
contrib/raftexample: add test for httpKVAPI.
2019-03-28 11:39:45 -07:00
johncming 4452d4be22 contrib/raftexample: fix naked return. 2019-03-20 09:52:12 +08:00
johncming 51cdbb6d1a contrib/raftexample: add test for struct httpKVAPI. 2019-03-19 11:12:47 +08:00
johncming e46af034df bugfix: adjust or add close request body.
affected modules:
- lease/leasehttp
- contrib/raftexample
2019-03-12 22:41:55 +08:00
Trung Nguyen 5b4ff6c6d5
raftexample: update readme 2019-02-21 16:56:52 -05:00
Trung Nguyen 74d6df2bd6
raftexample: added build instruction and minor refactoring 2019-02-21 15:00:38 -05:00
Xiang Li dac8c6fcc0
Merge pull request #10167 from nvanbenschoten/nvanbenschoten/limitUncommitted
raft: provide protection against unbounded Raft log growth
2018-10-13 23:52:28 -07:00
Nathan VanBenschoten f89b06dc6d raft: provide protection against unbounded Raft log growth
The suggested pattern for Raft proposals is that they be retried
periodically until they succeed. This turns out to be an issue
when a leader cannot commit entries because the leader will continue
to append re-proposed entries to its log without committing anything.
This can result in the uncommitted tail of a leader's log growing
without bound until it is able to commit entries.

This change add a safeguard to protect against this case where a
leader's log can grow without bound during loss of quorum scenarios.
It does so by introducing a new, optional ``MaxUncommittedEntriesSize
configuration. This config limits the max aggregate size of uncommitted
entries that may be appended to a leader's log. Once this limit
is exceeded, proposals will begin to return ErrProposalDropped
errors.

See cockroachdb/cockroach#27772
2018-10-13 23:25:05 -04:00
Wenjia 1cab49ef78
Merge pull request #9718 from kchristidis/fix-snap-pub-error
raftexample: Fix publish snapshot error message
2018-10-11 16:45:55 -07:00
caoming dd6e579b84 raftexample: use Rlock instead of Lock in getsnapshot 2018-09-19 13:25:47 +08:00
Vimal K bcde798fdd *: path changes for moving to github/etcd-io/etcd 2018-09-03 21:57:23 +05:30
Vimal K 9bad6fd442 contrib/recipes/watch.go : cancel() the watch after desired watch event
fixes #9882
2018-09-01 18:18:24 +05:30
Gyuho Lee c0f6597c02 contrib/systemd: remove v2 service files
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 18:35:01 -07:00
Gyuho Lee d37f1521b7 *: update import paths to "go.etcd.io/etcd"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 17:47:55 -07:00
Iskander Sharipov 1de9e1b00d contrib/recipes: use clientv3.NoLease instead of 0
If we have a named const, it's more readable to use that.

Found using https://go-critic.github.io/overview#namedConst-ref
2018-07-28 23:56:45 +03:00
Kostas Christidis 9431532730 raftexample: Fix publish snapshot error message
The error message is different to the condition it checks for. This PR
modifies the error message accordingly.

Closes #9717.

Signed-off-by: Kostas Christidis <kostas@christidis.io>
2018-07-26 11:14:15 -04:00
Gyuho Lee 42bef8460c *: clean up code format
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-07-21 16:34:56 -07: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 04df89bc11 contrib/raftexample: rename internal packages
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-21 07:45:34 -07:00
Gyuho Lee 4a0bf23d1f contrib/raftexample: rename "snapCount"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-18 14:39:47 -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
Sam Batschelet 4c928813fb contrib: add gRPC gateway script for user/add with full chain TLS. 2018-05-04 10:03:26 -04:00
Xiang Li 02ed51d300
Merge pull request #9657 from yaojingguo/remove-dead-code
contrib/raftexample: remove useless check
2018-05-01 10:19:35 -07:00
Jingguo Yao 0303480b1a contrib/raftexample: fix typo 2018-05-01 11:22:36 +08:00
Jingguo Yao cfa1efc7eb contrib/raftexample: remove useless check
`err == raftsnap.ErrNoSnapshot` being false implies that
`err != raftsnap.ErrNoSnapshot` is true.
2018-04-29 11:34:44 +08:00
Gyuho Lee 9063805180 contrib/tools: support structured logger
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-16 17:36:00 -07:00
John Eismeier ca47aab373
*: fix typos in markdown docs 2018-03-07 10:32:07 -05: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 9b5d6edc4b *: revert "internal/raftsnap"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-26 17:11:40 -08:00
Gyuho Lee 80d15948bc *: move "mvcc" to "internal/mvcc"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-26 11:14:41 -08:00
Gyuho Lee dee39bf786 internal/raftsnap: move "raftsnap" to internal
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-24 10:36:04 -08:00
Gyuho Lee 2b6fd3094f *: rename "snap" to "raftsnap" package
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-24 10:26:07 -08:00
Gyu-Ho Lee 75110dd839 *: fix naked returns
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-11-10 18:46:15 -08:00
Gyu-Ho Lee f65aee0759 *: replace 'golang.org/x/net/context' with 'context'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-09-07 13:39:42 -07:00
Gyu-Ho Lee f78498b42a contrib/raftexample: use bytes.Buffer.String (no 'string()')
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-07-18 16:06:22 -07:00
Jackson Owens 74e020b715 contrib/raftexample: save snapshot to WAL first
Save the snapshot index to the WAL before saving the snapshot to the
filesystem. This ensures that we'll only ever call wal.Open with a
snapshot that was previously saved to the WAL.
2017-06-13 11:24:07 -07:00
Anthony Romano 887db5a3db *: fix go tool vet -all -shadow errors 2017-06-03 21:32:36 -07:00
Anthony Romano 33c375dc44 *: fill out blank package godocs
Mostly one-liner short descriptions, but also includes some typo fixes
and some examples.
2017-05-18 09:41:13 -07:00
Anthony Romano c8a2c7f64f *: eschew you from documentation
Removed line wrapping in affected files as well.
2017-03-06 11:40:46 -08:00
Hitoshi Mitake b6eedbacf9 contrib: suppress gosimple errors of raftexample
Travis claimed errors of gosimple like below
(https://travis-ci.org/coreos/etcd/jobs/208098545):
gosimple checking failed:
contrib/raftexample/raftexample_test.go:78:6: should write erri := <-clus.errorC[i] instead of erri, _ := <-clus.errorC[i]
contrib/raftexample/raftexample_test.go:114:10: should write err := <-eC instead of err, _ := <-eC

This commit fixes the errors.
2017-03-06 16:17:22 +09:00
Gyu-Ho Lee 19d30fd4a7 contrib: add etcd cluster deploy on systemd docs
Fix https://github.com/coreos/etcd/issues/5971
2017-01-26 16:56:55 -08:00
Vimal Kumar 6443c25422 contrib/recipes/key.go : fixed method comment 2017-01-23 23:42:50 +05:30
Gyu-Ho Lee 0af1679b61 raftexample: load snapshot when opening WAL
Fix https://github.com/coreos/etcd/issues/7056.
Previously we don't load snapshot when replaying WAL.
2016-12-30 17:28:57 -08:00
Vincent Lee e8d06d8e4d raftexample: confState should be saved after apply 2016-11-20 16:51:33 +08:00
Anthony Romano 8f718e2e5a contrib/recipes: unexport and clean up keys.go
Fixes #6731
2016-10-28 11:41:13 -04:00
Gyu-Ho Lee 113b27229b raftexample: remove snapshot TODO in README 2016-09-21 05:07:04 -07:00
Gyu-Ho Lee e4fbf7db00 raftexample: implement Raft snapshot 2016-09-21 04:23:05 -07:00