619 Commits

Author SHA1 Message Date
Marek Siarkowicz
08407ff760 version: bump up to 3.5.4 2022-04-24 12:44:36 +02:00
ahrtr
5c68f2e510 Update conssitent_index when applying fails
When clients have no permission to perform whatever operation, then
the applying may fail. We should also move consistent_index forward
in this case, otherwise the consitent_index may smaller than the
snapshot index.
2022-04-20 22:17:49 +08:00
Marek Siarkowicz
0452feec71 version: bump up to 3.5.3 2022-04-13 17:17:51 +02:00
Marek Siarkowicz
003a310489
Merge pull request #13933 from ahrtr/fix_snapshot_recover_cindex_3.5
[3.5]Set backend to cindex before recovering the lessor in applySnapshot
2022-04-12 10:46:55 +02:00
ahrtr
4002aa51bd set backend to cindex before recovering the lessor in applySnapshot 2022-04-12 15:56:14 +08:00
ahrtr
bc5307de95 support linearizable renew lease
When etcdserver receives a LeaseRenew request, it may be still in
progress of processing the LeaseGrantRequest on exact the same
leaseID. Accordingly it may return a TTL=0 to client due to the
leaseID not found error. So the leader should wait for the appliedID
to be available before processing client requests.
2022-04-12 14:12:45 +08:00
Marek Siarkowicz
383eceb885
Merge pull request #13669 from maxsokolovsky/upgrade-server-dependency-golang.org/x/crypto
etcdserver: upgrade the golang.org/x/crypto dependency
2022-04-09 09:44:05 +02:00
ahrtr
66c7aab4d3 fix the data inconsistency issue by adding a txPostLockHook into the backend
Previously the SetConsistentIndex() is called during the apply workflow,
but it's outside the db transaction. If a commit happens between SetConsistentIndex
and the following apply workflow, and etcd crashes for whatever reason right
after the commit, then etcd commits an incomplete transaction to db.
Eventually etcd runs into the data inconsistency issue.

In this commit, we move the SetConsistentIndex into a txPostLockHook, so
it will be executed inside the transaction lock.
2022-04-08 20:37:34 +08:00
Marek Siarkowicz
780ec338f0 server: Save consistency index and term to backend even when they decrease
Reason to store CI and term in backend was to make db fully independent
snapshot, it was never meant to interfere with apply logic. Skip of CI
was introduced for v2->v3 migration where we wanted to prevent it from
decreasing when replaying wal in
https://github.com/etcd-io/etcd/pull/5391. By mistake it was added to
apply flow during refactor in
https://github.com/etcd-io/etcd/pull/12855#commitcomment-70713670.

Consistency index and term should only be negotiated and used by raft to make
decisions. Their values should only driven by raft state machine and
backend should only be responsible for storing them.
2022-04-07 21:22:18 +02:00
Marek Siarkowicz
238b18c110
Merge pull request #13895 from mrueg/rel3.5-client_golang
[release-3.5] go.mod: Upgrade to prometheus/client_golang v1.11.1
2022-04-07 09:38:43 +02:00
Marek Siarkowicz
83538f342d server: Add verification of whether lock was called within out outside of apply 2022-04-06 11:22:51 +02:00
Manuel Rüger
3b8c6512df go.mod: Upgrade to prometheus/client_golang v1.11.1 2022-04-06 00:35:48 +02:00
Marek Siarkowicz
a060b42e47 server: Use default logging configuration instead of zap production one
This fixes problem where logs json changes format of timestamp.
2022-04-01 12:23:44 +02:00
Marek Siarkowicz
39baf36ca3
Merge pull request #13726 from chaochn47/backport_13676_to_3_5
backport 3.5: #13676 load all leases from backend
2022-03-08 10:40:28 +01:00
Marek Siarkowicz
541635e36a
Merge pull request #13701 from lavacat/defrag-bopts-fix-3.5
server/storage/backend: restore original bolt db options after defrag
2022-03-08 10:38:31 +01:00
Chao Chen
f634b44046 backport 3.5: #13676 load all leases from backend 2022-02-22 10:21:04 -08:00
ahrtr
7db1051774 enhance health check endpoint to support serializable request 2022-02-17 15:03:22 +08:00
Bogdan Kanivets
631fa6fd65 server/storage/backend: restore original bolt db options after defrag
Problem: Defrag was implemented before custom bolt options were added.
Currently defrag doesn't restore backend options.
For example BackendFreelistType will be unset after defrag.

Solution: save bolt db options and use them in defrag.
2022-02-15 10:56:07 -08:00
Max Sokolovsky
f4708ae3d4 etcdserver: upgrade the golang.org/x/crypto dependency
To rectify the vulnerability found in a version of golang.org/x/crypto
(https://avd.aquasec.com/nvd/cve-2020-29652), upgrade the dependency to
its latest version.
Alternatively, version v0.0.0-20201216223049-8b5274cf687f could be used,
where the fixed was introduced, but the latest is preferable.
2022-02-07 10:11:46 -05:00
Marek Siarkowicz
99018a77be version: bump up to 3.5.2 2022-02-01 12:28:34 +01:00
leoyang.yl
55c16df997 fix runlock bug 2021-12-16 15:58:41 +00:00
Piotr Tabor
73080a7166
Merge pull request #13501 from ahrtr/reset_ci_after_reload_db_3.5
[3.5] Set the backend again after recovering v3 backend from snapshot
2021-12-06 13:22:22 +01:00
Marek Siarkowicz
d00e89db2e server: Require either cluster version v3.6 or --experimental-enable-lease-checkpoint-persist to persist lease remainingTTL
To avoid inconsistant behavior during cluster upgrade we are feature
gating persistance behind cluster version. This should ensure that
all cluster members are upgraded to v3.6 before changing behavior.

To allow backporting this fix to v3.5 we are also introducing flag
--experimental-enable-lease-checkpoint-persist that will allow for
smooth upgrade in v3.5 clusters with this feature enabled.
2021-12-02 16:54:10 +01:00
Michał Jasionowski
eddfb4232f etcdserver,integration: Store remaining TTL on checkpoint
To extend lease checkpointing mechanism to cases when the whole etcd
cluster is restarted.
2021-12-02 16:42:20 +01:00
Michał Jasionowski
21634a98c6 lease,integration: add checkpoint scheduling after leader change
Current checkpointing mechanism is buggy. New checkpoints for any lease
are scheduled only until the first leader change. Added fix for that
and a test that will check it.
2021-12-02 16:40:14 +01:00
ahrtr
8c81598455 set the backend again after recovering v3 backend from snapshot 2021-11-25 05:45:20 +08:00
Hitoshi Mitake
dec6f72d68 *: implement a retry logic for auth old revision in the client 2021-11-15 00:09:16 +09:00
Chao Chen
7d44a7cd6e server/etcdserver/api/etcdhttp: exclude the same alarm type activated by multiple peers 2021-11-12 14:21:14 -08:00
Geeta Gharpure
446f7d6b6e storage/backend: Add a gauge to indicate if defrag is active (backport from 3.6) 2021-10-06 11:01:31 -07:00
Sam Batschelet
d42e8589e1 version: 3.5.1
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2021-10-03 11:47:37 -04:00
Marek Siarkowicz
58d2b12a50 client: Add grpc authority header integration tests 2021-09-30 12:15:32 +02:00
Marek Siarkowicz
e68c7ab4bc server: Ensure that adding and removing members handle storev2 and backend out of sync 2021-09-15 14:36:41 +02:00
tangcong
627d91c89d fix self-signed-cert-validity parameter cannot be specified in the config file 2021-07-30 07:53:43 +08:00
tangcong
dfd2fea4c5 fix health endpoint not usable when authentication is enabled 2021-07-30 07:53:40 +08:00
Sam Batschelet
946a5a6f25 version: 3.5.0
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2021-06-15 17:34:52 -04:00
spacewander
53e04b2615 embed: unlimit the recv msg size of grpc-gateway
Ensure the client which access etcd via grpc-gateway won't
be limited by the MaxCallRecvMsgSize. Here we choose the same
default value of etcdcli as grpc-gateway's MaxCallRecvMsgSize.

Fix https://github.com/etcd-io/etcd/issues/12576
2021-06-11 07:53:49 +08:00
Sam Batschelet
8139dd3e55 version: 3.5.0-rc.1
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2021-06-09 17:57:52 -04:00
Mr-Mu
98bbc0107f TestLogRotation add log output relative path
TestLogRotation add test log output relative path test
2021-06-09 14:12:07 -04:00
Mr-Mu
fed3bc3084 [Fix]滚动日志路径解析不正确
例如  rotate:test.log 路径解析不正确
2021-06-09 14:12:07 -04:00
Lili Cosic
9fee8bf95e Update client_golang dependency to v1.11.0 2021-06-07 15:54:57 +02:00
J. David Lowe
e27effa250 etcdserver: don't attempt to grant nil permission to a role
Prevent etcd from crashing when given a bad grant payload, e.g.:

$ curl -d '{"name": "foo"}' http://localhost:2379/v3/auth/role/add
{"header":{"cluster_id":"14841639068965178418", ...
$ curl -d '{"name": "foo"}' http://localhost:2379/v3/auth/role/grant
curl: (52) Empty reply from server

Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2021-06-04 15:34:22 -07:00
J. David Lowe
ae194c1470 etcdserver: don't activate alarm w/missing AlarmType
Narrowly prevent etcd from crashing when given a bad ACTIVATE payload, e.g.:

$ curl -d "{\"action\":\"ACTIVATE\"}" ${ETCD}/v3/maintenance/alarm
curl: (52) Empty reply from server
2021-06-04 14:21:04 -07:00
Sam Batschelet
ab20aa29a0 version: 3.5.0-rc.0
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2021-06-03 21:39:37 -04:00
Wilson Wang
4563cebaa4 server: skip unnecessary sprintf which executes proto.Size()
(cherry picked from commit 11edc76b15f0a1b8a3cf7e2d91f59978b93407b5)
2021-06-03 13:21:23 -07:00
Piotr Tabor
a5523be415 Update of dependencies:
- zap-1.17.0
  - bbolt-1.3.6
  - grpc -1.38
  - github.com/coreos/go-systemd/v22 v22.3.2
  - github.com/google/btree v1.0.1
  - github.com/json-iterator/go v1.1.11
2021-06-03 15:19:33 +02:00
Marek Siarkowicz
9a18742bd7 etcdserver: Fix invalid count returned on Range with Limit 2021-06-01 16:12:53 +02:00
Sam Batschelet
6cd7c02873
Merge pull request #13055 from ptabor/20210528-beckport-integration-fixes 2021-05-30 16:35:15 -04:00
Piotr Tabor
3f13d3a2d5 integration.BeforeTest can be run without leak-detection. 2021-05-28 10:01:36 +02:00
Piotr Tabor
4af7fc393c Expose clientv3.CreateDefaultZapLoggerConfig
Need raised in
f3f4259d3f.

BTW: Alligned the implementation of grpclogs with what we use in embed server, so reduced the client code dependencies.
2021-05-26 12:52:46 +02:00
Sam Batschelet
b3f16d6691 version: 3.5.0-beta.4
Signed-off-by: Sam Batschelet <sbatsche@redhat.com>
2021-05-25 20:48:48 -04:00