137 Commits

Author SHA1 Message Date
Piotr Tabor
ffea1537d4 ClientV3 tests use integration.NewClient that configures proper logger. 2021-04-29 18:18:34 +02:00
Tom Wilkie
562d645ac9
Fix the mixin.
Signed-off-by: Tom Wilkie <tom@grafana.com>
2021-04-13 19:38:55 +01:00
Piotr Tabor
bad0b4d513
Merge pull request #12823 from mtulio/chore/dash-var-refresh
chore/dash-var-refresh: change default refresh to 2(time range)
2021-04-08 15:14:53 +02:00
Marco Tulio R Braga
aeeecc06cf
fix/dash-var-refresh: add const and description 2021-04-08 10:12:41 -03:00
Piotr Tabor
816d332d81
Merge pull request #12830 from ptabor/20210405-split-pkg
Split client/pkg as dedicated low-dependencies module for client
2021-04-08 00:48:41 +02:00
Piotr Tabor
3bb7acc8cf Migrate dependencies pkg/foo -> client/pkg/foo 2021-04-07 00:38:47 +02:00
Patrice Chalin
2ba69de281 Contrib lock example 2021-04-06 15:21:01 -04:00
Marco Braga
d2bc5343fb chore/dash-var-refresh: change default refresh to 2(time range) 2021-04-01 00:06:57 -03:00
Piotr Tabor
fce0c192eb Regenerate protos. 2021-03-25 00:31:44 +01:00
Piotr Tabor
3976d68ed3 raftExample: Allow closing raftexample node when snapshotting.
Fix race that made the raftExample test fail.
2021-02-26 08:56:12 +01:00
Shintaro Murakami
5ae3f879c9 raftexample: Return an appropriate applyDoneC 2021-02-24 21:28:18 +09:00
Shintaro Murakami
cb0d256a18 raftexample: Add test for adding new node to existing cluster 2021-02-22 13:44:33 +09:00
Shintaro Murakami
1b1be43d65 raftexample: New joined node have to start with RestartNode 2021-02-22 09:45:44 +09:00
Shintaro Murakami
cc2b039817 raftexample: Explicitly notify all committed entries are applied 2021-02-19 19:26:36 +09:00
Shintaro Murakami
2d25f7f3da raftexample: Implement ReportUnreachable and ReportSnapshot 2021-02-17 11:59:32 +09:00
Shintaro Murakami
1302e1edb2 raftexample: Save snapshot file before writing to wal 2021-02-16 13:30:15 +09:00
Piotr Tabor
1395a1a795 Migrate back mixin to contrib/
The mixin was moved out together with documentation.
This broke kube-prometheous: https://github.com/etcd-io/etcd/issues/12685#issuecomment-777264143
2021-02-11 09:28:30 +01:00
Piotr Tabor
e8ba375032
Merge pull request #11889 from mrkm4ntr/example-recover-from-snap
raftexample: Fix recovery from snapshot
2021-02-10 12:18:30 +01:00
Shintaro Murakami
be2167ebab Wait until all committed entries are applied
To take a snapshot
2021-02-05 19:05:41 +09:00
Shintaro Murakami
cb14cdd774 raftexample: Fix recovery from snapshot
* If there is a snapshot, HTTP server won't start.
* Resotring form snapshot occurs after replaying WAL.
* When taking a snapshot, the last change is not applied to the state machine yet.
2021-02-05 09:34:34 +09:00
Piotr Tabor
b5d11723d1
Merge pull request #12393 from viviyww/contrib-doc
contrib: del systemd/etcd2-backup-coreos in docs
2021-02-01 15:33:44 +01:00
Piotr Tabor
4af159a30a
Merge pull request #12259 from alvistack/master-aio_graceful_reboot
`etcd.service`: Define explicit dependencies of systemd etcd service
2021-01-31 23:58:12 +01:00
Luca BRUNO
b0e2c70c71
contrib/systemd: add a sysusers entry
This adds a sysusers.d file, in order to create a system user/group
which matches the one used by the service unit.

Ref: https://www.freedesktop.org/software/systemd/man/sysusers.d.html
2020-12-09 13:59:46 +00:00
Piotr Tabor
aaf423e962 server: Update imports.
find -name '*.go' | xargs sed -i --follow-symlinks 's|etcd/v3/|etcd/server/v3/|g'
2020-10-26 13:02:32 +01:00
Piotr Tabor
45b007b8b4 contrib,clientv3: Move contrib/recipies to clientv3/experimental/recipies/...
Recipies is set of patterns / primitives implementation on top of clientv3.
It's used by integration tests. It shouldn't be considered "server" code.
2020-10-22 11:10:07 +02:00
Piotr Tabor
e33c6dd9df client/v3: Rename of imports 2020-10-20 10:13:06 +02:00
Piotr Tabor
e62417297d *: Rename of imports of raft (as its now a module)
% find -name '*.go' -o -name '*.md' -o -name '*.sh' | xargs sed -i --follow-symlinks 's|etcd/v3/raft|etcd/raft/v3|g'
2020-10-16 13:58:18 +02:00
yangweiwei
5d3609e3cf contrib: del systemd/etcd2-backup-coreos in docs
del systemd/etcd2-back-coreos in docs
2020-10-14 09:49:56 +08:00
Piotr Tabor
de55bb6331 pkg: Rename imports after making 'pkg' a module
find -name '*.go' | xargs sed --follow-symlinks -i 's|go.etcd.io/etcd/v3/pkg/|go.etcd.io/etcd/pkg/v3/|g'
go fmt ./...
2020-10-13 00:09:27 +02:00
Piotr Tabor
28f2b07623 *: Update references to code moved to the api/ dir.
Follow up to file-moves done in the previous commit.

The commit contains purely mechanical consequences of execution (apart
of scripts/genproto.sh):

  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/etcdserver/api/v3rpc/rpctypes|v3/api/v3rpc/rpctypes|g'
  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/version|v3/api/version|g'
  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/mvcc/mvccpb|v3/api/mvccpb|g'
  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/etcdserver/etcdserverpb|v3/api/etcdserverpb|g'
  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/etcdserver/api/membership/membershippb|v3/api/membershippb|g'
  % find ./ -name '*.go'  | xargs sed --follow-symlinks -i 's|v3/auth/authpb|v3/api/authpb|g'

  % find ./ -name '*.proto' -o -name '*.md'  | xargs -L 1 sed --follow-symlinks -i 's|/mvcc/mvccpb/kv.proto|/api/mvccpb/kv.proto|g'
  % find ./ -name '*.proto' -o -name '*.md'  | xargs -L 1 sed --follow-symlinks -i 's|/auth/authpb/auth.proto|/api/authpb/auth.proto|g'
  % find ./ -name '*.proto' -o -name '*.md'  | xargs -L 1 sed --follow-symlinks -i 's|/etcdserver/api/membership/membershippb/membership.proto|/api/membershippb/membership.proto|g'

  I also modified manually paths in scripts/genproto.sh.

  % go fmt ./...
2020-10-06 11:56:16 +02:00
Wong Hoi Sing Edison
17ceed9b47
etcd.service: Support Graceful Reboot for AIO Node
Currently our sample systemd service file `contrib/systemd/etcd.service`
have startup/shutdown dependency as below:

    [Unit]
    After=network.target

For some rare condition, e.g. bare matel deployment with slow network
startup, IP could not be assigned e arly enough before etcd default
`ETCD_HEARTBEAT_INTERVAL="100"` and `ETCD_ELECTION_TIMEOUT="1000"` get
timeouted, after graceful system reboot.

This cause etcd false negative classify itself use unhealthy, therefore
stop rejoining the remaining online cluster members.

This PR introduce:

  - `etcd.service`: Ensure startup after `network-online.target` and
    `time-sync.target`, so effective network connectivity and synced
    time is available.

The logic is concept proof by
<https://github.com/alvistack/ansible-role-etcd/tree/develop>; also
works as expected with Ceph + Kubernetes deployment by
<https://github.com/alvistack/ansible-collection-kubernetes/tree/develop>.
No more deadlock happened during graceful system reboot, both AIO
single/multiple node with loopback mount.

Also see:

  - <https://github.com/ceph/ceph/pull/36776>
  - <https://github.com/etcd-io/etcd/pull/12259>
  - <https://github.com/cri-o/cri-o/pull/4128>
  - <https://github.com/kubernetes/release/pull/1504>

Signed-off-by: Wong Hoi Sing Edison <hswong3i@gmail.com>
2020-09-17 16:59:12 +08:00
Brandon Philips
96cce208c2 go.mod: use go.etcd.io/etcd/v3 versioning
This change makes the etcd package compatible with the existing Go
ecosystem for module versioning.

Used this tool to update package imports:
  https://github.com/KSubedi/gomove
2020-04-28 00:57:35 +00:00
Jingyi Hu
61f279454e
etcdserver/api: remove capnslog (#11606)
* etcdserver/api/rafthttp: remove capnslog

* etcdserver/api/membership: remove capnslog

* etcdserver/api/v2auth: remove capnslog

* etcdserver/api/v2discovery: remove capnslog

* etdserver/api/v2stats: remove capnslog

* etcdserver/api/v2http: remove capnslog

* etcdserver/api/v3rpc: remove capnslog

* etcdserver/api: remove capnslog

Remove capnslog from etcdserver/api. Note that capnslog was
already removed in some packages under etcdserver/api in
previous commits.
2020-02-11 13:51:25 -08:00
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