Marek Siarkowicz
a9e0a04c9a
server: Extract resolveUrl helper function
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-30 15:11:59 +02:00
Marek Siarkowicz
245067b15d
server: Separate client listener grouping from serving
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-30 15:11:59 +02:00
Marek Siarkowicz
63576a25f5
refactor: Use proper variable names for urls
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-30 15:11:58 +02:00
Wei Fu
9e974792f9
server/embed: fix data race when start insecure grpc
...
There are two goroutines accessing the `gs` grpc server var. Before
insecure `gs` server start, the `gs` can be changed to secure server and
then the client will fail to connect to etcd with insecure request. It
is data-race. We should use argument for reference in the new goroutine.
fix : #15495
Signed-off-by: Wei Fu <fuweid89@gmail.com>
(cherry picked from commit a9988e2625eede1af81d189b5f2ecf7d4af3edf1)
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-03-20 20:41:49 +08:00
Marek Siarkowicz
92e56ab61e
server: Test watch restore
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-20 12:04:43 +01:00
Bogdan Kanivets
dafdaaedf2
mvcc: update minRev when watcher stays synced
...
Problem: during restore in watchableStore.Restore, synced watchers are moved to unsynced.
minRev will be behind since it's not updated when watcher stays synced.
Solution: update minRev
fixes: https://github.com/etcd-io/etcd/issues/15271
Signed-off-by: Bogdan Kanivets <bkanivets@apple.com>
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-20 12:02:49 +01:00
Benjamin Wang
11ca1d356a
Merge pull request #15483 from jmhbnz/release-3.5-backport
...
[3.5] Backport tls 1.3 support
2023-03-16 06:06:45 +08:00
James Blair
358bcf3fb6
Backport tls 1.3 support.
...
Signed-off-by: James Blair <mail@jamesblair.net>
2023-03-15 14:10:14 +13:00
Marek Siarkowicz
55bfad950c
server: Switch back to random scheduler to improve resilience to watch starvation
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-03-14 09:16:46 +01:00
James Blair
1ea808b5ba
Backport go_srcs_in_module changes and fix goword failures.
...
Signed-off-by: James Blair <mail@jamesblair.net>
2023-02-24 22:01:41 +13:00
James Blair
183af509f6
Formatted source code for go 1.19.6.
...
Signed-off-by: James Blair <mail@jamesblair.net>
2023-02-20 21:33:59 +13:00
James Blair
1bd835383b
Bump to go 1.19.6
...
Signed-off-by: James Blair <mail@jamesblair.net>
2023-02-20 12:52:43 +13:00
James Blair
5996b5faa3
Bump golang.org/x/net to v0.7.0 to address CVE GO-2023-1571.
...
Signed-off-by: James Blair <mail@jamesblair.net>
2023-02-20 12:51:17 +13:00
Benjamin Wang
452164a1c7
etcdserver: add failpoints walBeforeSync and walAfterSync
...
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-02-09 07:03:04 +08:00
Paco Xu
2a0ecd4078
upgrade cockroachdb/datadriven to v1.0.2 to remove archived dependencies
...
Signed-off-by: Paco Xu <paco.xu@daocloud.io>
2023-01-31 14:42:15 +08:00
Benjamin Wang
747de58414
bump bbolt to v1.3.7 for release-3.5
...
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-01-31 07:12:46 +08:00
Marek Siarkowicz
215b53cf3b
version: bump up to 3.5.7
2023-01-20 11:15:12 +01:00
Benjamin Wang
53300ece3b
etcdserver: return membership.ErrIDNotFound when the memberID not found
...
Backport https://github.com/etcd-io/etcd/pull/15095 .
When promoting a learner, we need to wait until the leader's applied ID
catches up to the commitId. Afterwards, check whether the learner ID
exist or not, and return `membership.ErrIDNotFound` directly in the API
if the member ID not found, to avoid the request being unnecessarily
delivered to raft.
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-01-17 06:24:27 +08:00
Benjamin Wang
e1fc545d8a
etcdserver: process the scenaro of the last WAL record being partially synced to disk
...
We need to return io.ErrUnexpectedEOF in the error chain, so that
etcdserver can repair it automatically.
Backport https://github.com/etcd-io/etcd/pull/15068
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-01-08 05:30:01 +08:00
Benjamin Wang
a612b9285f
format the source code and tidy the dependencies using go 1.17.13
...
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-19 13:26:59 +08:00
Benjamin Wang
69ee8a83ab
bump go version to 1.17.13
...
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-19 13:23:16 +08:00
Benjamin Wang
3337f35f17
deps: bump golang.org/x/net to v0.4.0 to address CVEs
...
CVE-2021-44716
CVE-2022-27664
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-19 09:28:07 +08:00
Benjamin Wang
c1a89973f0
etcdserver: fix nil pointer panic for readonly txn
...
Backporting https://github.com/etcd-io/etcd/pull/14895
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-06 18:16:49 +08:00
Chao Chen
378ad6b517
[3.5] Backport: non mutating requests pass through quotaKVServer when NOSPACE
...
Signed-off-by: Vaibhav Mehta <mehvaibh@amazon.com>
2022-12-05 21:04:09 +00:00
Benjamin Wang
ba122c9d56
etcdserver: intentionally set the memberID as 0 in corruption alarm
...
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-25 16:23:37 +08:00
Marek Siarkowicz
cecbe35ce0
version: bump up to 3.5.6
2022-11-21 15:54:14 +01:00
Aleksandr Razumov
c91978077b
client/pkg/fileutil: add missing logger to {Create,Touch}DirAll
...
Also populate it to every invocation.
Signed-off-by: WangXiaoxiao <1141195807@qq.com>
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-11-17 14:08:30 +01:00
Benjamin Wang
563713e128
etcdserver: call the OnPreCommitUnsafe in unsafeCommit
...
`unsafeCommit` is called by both `(*batchTxBuffered) commit` and
`(*backend) defrag`. When users perform the defragmentation
operation, etcd doesn't update the consistent index. If etcd
crashes(e.g. panicking) in the process for whatever reason, then
etcd replays the WAL entries starting from the latest snapshot,
accordingly it may re-apply entries which might have already been
applied, eventually the revision isn't consistent with other members.
Refer to discussion in https://github.com/etcd-io/etcd/pull/14685
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-11-11 17:35:26 +08:00
Cenk Alti
be4adc0c55
server: add more context to panic message
...
Signed-off-by: Cenk Alti <cenkalti@gmail.com>
2022-11-01 19:02:32 -04:00
Hitoshi Mitake
1e96e0be38
etcdserver: call refreshRangePermCache on Recover() in AuthStore. #14574
...
Signed-off-by: Oleg Guba <oleg@dropbox.com>
Signed-off-by: Hitoshi Mitake <h.mitake@gmail.com>
2022-10-29 13:56:08 +09:00
Hitoshi Mitake
efb9480b96
server: add a unit test case for authStore.Reocver() with empty rangePermCache
...
Signed-off-by: Hitoshi Mitake <h.mitake@gmail.com>
2022-10-29 13:26:31 +09:00
Benjamin Wang
ec6f0a74ba
Merge pull request #14500 from dusk125/release-3.5
...
Release-3.5: server/etcdmain: add configurable cipher list to gRPC proxy listener
2022-10-16 06:35:17 +08:00
Benjamin Wang
f6c4c84da3
etcdserver: added more debug log for the purgeFile goroutine
...
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-10-12 19:28:32 +08:00
Kafuu Chino
dd983c662b
*: avoid closing a watch with ID 0 incorrectly
...
Signed-off-by: Kafuu Chino <KafuuChinoQ@gmail.com>
add test
1
1
1
1
1
1
2022-10-08 20:06:19 +08:00
Hitoshi Mitake
7b568f23ab
*: handle auth invalid token and old revision errors in watch
...
Signed-off-by: Hitoshi Mitake <h.mitake@gmail.com>
2022-10-03 23:00:13 +09:00
Sahdev Zala
db55011d7c
server/etcdmain: add configurable cipher list to gRPC proxy listener
...
Signed-off-by: Allen Ray <alray@redhat.com>
2022-09-29 11:41:57 -04:00
Haimantika Mitra
653d6e18c3
Replace github.com/form3tech-oss/jwt-go with https://github.com/golang-jwt/jwt/v4
...
Signed-off-by: haimantika mitra <haimantikamitra@gmail.com>
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2022-09-19 15:35:08 -04:00
Marek Siarkowicz
19002cfc68
version: bump up to 3.5.5
2022-09-15 14:02:30 +02:00
Benjamin Wang
6c26693ebe
Merge pull request #14178 from lavacat/release-3.5-txn-panic
...
[3.5] server: don't panic in readonly serializable txn
2022-09-13 14:44:38 +08:00
Vladimir Sokolov
eef5e220a6
testing: fix TestOpenWithMaxIndex cleanup
...
A WAL object was closed by defer, however the WAL was rewritten afterwards,
so defer closed already closed WAL but not the new one. It caused a data
race between writing file and cleaning up a temporary test directory,
which led to a non-deterministic bug.
Fixes #14332
Signed-off-by: Vladimir Sokolov <vsvastey@gmail.com>
2022-09-08 11:26:10 +03:00
Vivek Patani
7639d93f15
server,test: refresh cache on each NewAuthStore
...
- permissions were incorrectly loaded on restarts.
- #14355
- Backport of https://github.com/etcd-io/etcd/pull/14358
Signed-off-by: vivekpatani <9080894+vivekpatani@users.noreply.github.com>
2022-09-07 10:22:05 -07:00
Marek Siarkowicz
2ddb9e0883
tests: Fix member id in CORRUPT alarm
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-09-07 15:11:56 +02:00
Marek Siarkowicz
5660bf0e7f
server: Make corrtuption check optional and period configurable
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-09-07 15:11:56 +02:00
Marek Siarkowicz
21fb173f76
server: Implement compaction hash checking
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-09-07 15:11:56 +02:00
Marek Siarkowicz
4a75e3d52d
server: Refactor compaction checker
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-09-07 15:11:55 +02:00
Marek Siarkowicz
8d4ca10ece
tests: Move CorruptBBolt to testutil
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-09-07 15:11:55 +02:00
Marek Siarkowicz
037a898ba0
tests: Unify TestCompactionHash and extend it to also Delete keys and Defrag
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-09-07 15:11:55 +02:00
Marek Siarkowicz
00bc8da0ef
tests: Add tests for HashByRev HTTP API
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-09-07 15:11:55 +02:00
Marek Siarkowicz
1200b1006d
server: Cache compaction hash for HashByRev API
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-09-07 15:11:55 +02:00
Marek Siarkowicz
7358362c99
server: Extract hasher to separate interface
...
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2022-09-07 15:11:55 +02:00