Commit Graph

172 Commits

Author SHA1 Message Date
f9ce13e7ee Avoid deadlock in etcd.Close when stopping during bootstrapping
Signed-off-by: Joshua Zhang <joshua.x.zhang@gmail.com>
2025-01-09 05:31:35 +00:00
c73b3d1e8f migrate experimental-txn-mode-write-with-shared-buffer flag to feature gate.
Signed-off-by: ishan16696 <ishan.tyagi@sap.com>
2024-12-21 23:46:11 +05:30
85363bda32 migrate experimental-compact-hash-check-enabled to feature gate.
Signed-off-by: Siyuan Zhang <sizhang@google.com>
2024-12-17 09:44:53 -08:00
093df6f4d2 Fix gofump error due to merge race
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-12-01 20:03:34 +01:00
6cebf973a1 Run a separate in memory snapshot to reduce number of entries stored in raft memory storage
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-11-29 20:40:02 +01:00
cfe958de6a Cleanup triggerSnapshot function and rename it to snapshotIfNeededAndCompactRaftLog
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-11-29 20:39:09 +01:00
d907ecdffd Separate memory and disk snapshot indexes
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-11-29 20:39:07 +01:00
9d55044494 Move updating snapshot index just after we safe snapshot to disk
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-11-29 20:38:20 +01:00
152973425a Rename snapshot variables to explicitly mention using disk
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-11-29 14:18:31 +01:00
b7812513ce Translate v2 requests into v3 ClusterMemberAttrSetRequest and ClusterVersionSetRequest
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-11-11 17:30:41 +01:00
8ec90c6088 Merge pull request #18780 from mmorel-35/server/errorlint
fix: enable errorlint in server directory
2024-10-30 22:55:43 +00:00
694b0fbdb6 refactor Etcdserver.snapshot to extract compaction into a separate method
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
2024-10-30 09:25:54 +00:00
3abdf612b3 fix: enable errorlint in server directory
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-10-26 08:16:47 +02:00
3374e27f19 etcdserver: fix panic when checking IsLearner of removed member
There was a concurrency bug when accessing the IsLearner
property of a member, which will panic with a nil pointer access error
if the member is removed between the IsMemberExist() and Member() calls.

Signed-off-by: Jan Schär <jan@monogon.tech>
2024-09-30 11:13:23 +02:00
d4df7a902e Replaces a number of error equality checks with errors.Is
Signed-off-by: redwrasse <mail@redwrasse.io>
2024-09-03 16:02:24 -07:00
b8b0cf83d1 Skip leadership check if the etcd instance is active processing heartbeat
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
2024-08-09 17:02:02 +01:00
d820cd2b56 etcdserver: change the snapshot + compact into sync operation
Signed-off-by: Clement <gh.2lgqz@aleeas.com>
2024-07-05 01:27:30 +08:00
60e3f45469 Adds all feature_gate from component-base.
We'll likely use most of the feature_gate package from component-base.
Also this commit moves the pkg from server/internal/pkg to pkg/.

Signed-off-by: Baek <seungtackbaek@google.com>
2024-06-15 05:34:58 +00:00
69ebaaebca featuregate: adds EtcdServer.FeatureEnabled interface.
The interface can be used throughout the etcd server binary to check if
the feature is enabled or not.

Note that this commit also copies necessary FeatureGate interface from
k8s component-base.

Signed-off-by: Baek <seungtackbaek@google.com>
2024-06-15 05:34:58 +00:00
c64c996c03 Revert quorum calculation: (active - 1) < 1+((len(m)-1)/2) calculates quorum after a member is deleted.
Signed-off-by: Max Neverov <neverov.max@gmail.com>
2024-04-17 07:55:24 +02:00
3b16aae947 Fix remove member failed.
Signed-off-by: Max Neverov <neverov.max@gmail.com>
2024-04-17 07:55:24 +02:00
14523bdc21 etcdserver: rename MemberId() to MemberID() to address var-naming
Signed-off-by: Ivan Valdes <ivan@vald.es>
2024-03-18 17:18:29 -07:00
c613b78e6c etcdserver: address golangci var-naming issues
Signed-off-by: Ivan Valdes <ivan@vald.es>
2024-03-18 17:17:07 -07:00
3565a822de Add VerifyTxConsistency to backend.
Signed-off-by: Siyuan Zhang <sizhang@google.com>

Update server/storage/backend/verify.go

Co-authored-by: Benjamin Wang <benjamin.wang@broadcom.com>

Update server/storage/backend/verify.go

Co-authored-by: Benjamin Wang <benjamin.wang@broadcom.com>
2024-02-22 11:31:16 -08:00
16a5e1da71 Added a error log when learner is not sync with etcd leader.
Signed-off-by: ishan16696 <ishan.tyagi@sap.com>
2024-01-30 15:42:11 +05:30
f7ab7adf29 server: fix learner metric incorrect issue
Signed-off-by: YaoC <chengyao09@hotmail.com>
2024-01-12 09:36:33 +00:00
a2eb17c809 Merge pull request #17199 from serathius/dont-flock
Don't flock snapshot files
2024-01-08 15:03:29 +01:00
3471ef133d Add an e2e test and robustness failpoint around recovering from snapshot backend
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-01-04 15:25:24 +01:00
7f8346b3f2 Don't flock snapshot files
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2024-01-04 14:53:44 +01:00
1e8d66ef95 Add beforeOpenSnapshotBackend failpoint
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-12-20 15:36:54 +01:00
67f17166bf Safeguard lease operations by double checking the leadership
1. ignore old leader's leases revoking request
2. double check current member's leadership before perform lease renew request
3. etcdserve: ensure current member's leadership before performing lease checkpoint request

Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
2023-12-15 17:53:36 +00:00
36b2523669 added some log messages for better diagnosis
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
2023-12-13 18:43:22 +00:00
fb769c4306 server: ignore raft messages if member id mismatch
Ignore Raft messages when the `To` field mismatches the local member ID.
In cases where incorrect Raft messages are dispatched, potentially due
to a malfunctioning switch, this proactive check prevents panics,
such as "tocommit is out of range".

Signed-off-by: Neil Shen <overvenus@gmail.com>
2023-12-07 11:57:45 +08:00
bc697bc26e Revert "Switch to validating v3 when v2 and v3 are synchronized"
This reverts commit 4fe46f9203.

Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-12-03 18:12:09 +01:00
03d551243b Merge pull request #17015 from serathius/extract-membership-applier
Extract membership applier
2023-11-27 19:59:21 +01:00
4fe46f9203 Switch to validating v3 when v2 and v3 are synchronized
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-11-24 17:46:33 +01:00
2ad21558ac Remove shouldApplyV3 from the v3 applier
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-11-24 16:13:25 +01:00
d22c00ccee Extract membership applier
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-11-24 15:57:15 +01:00
7fdb33065d Move duplicated shouldApplyV3 logic up into apply method
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-11-24 10:21:14 +01:00
093666f450 Cleanup v2 applier
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-11-23 15:41:13 +01:00
c72ff1e69c Remove syncing the v2 store TTLs
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-11-23 14:55:01 +01:00
dd7a4d28a8 Remove code used to make v2 proposals
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-11-19 22:39:33 +01:00
b4fd31f254 Remove code for setting cluster version via V2 API
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
2023-11-19 15:28:52 +01:00
1324f03254 add existing http health check handler e2e test
Signed-off-by: Chao Chen <chaochn@amazon.com>
2023-10-18 12:42:23 -07:00
628b45c099 test: add a test case to verify consistent memberlist on bootstrap
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-09-28 20:04:47 +01:00
aa97484166 *: enable goimports in verify-lint
Signed-off-by: Wei Fu <fuweid89@gmail.com>
2023-09-21 21:14:09 +08:00
c0aa3b613b Use any instead of interface{}
Signed-off-by: chenyahui <cyhone@qq.com>
2023-09-17 17:41:58 +08:00
8729417cee Preserve the order of steps done for snapshot
Signed-off-by: Geeta Gharpure <geetagh@amazon.com>
2023-08-22 19:12:37 +00:00
59332dc194 Update to generate v2 snapshot from v3 state
Signed-off-by: Geeta Gharpure <geetagh@amazon.com>
2023-08-21 19:18:11 +00:00
52748f60f3 all: stop using math/rand.Seed
Fixes #16428.

Signed-off-by: Jes Cok <xigua67damn@gmail.com>
2023-08-20 16:34:44 +08:00