Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix remove member failed. #17793

Merged
merged 4 commits into from Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/etcdserver/server.go
Expand Up @@ -86,7 +86,7 @@ const (
StoreKeysPrefix = "/1"

// HealthInterval is the minimum time the cluster should be healthy
// before accepting add member requests.
// before accepting add and delete member requests.
HealthInterval = 5 * time.Second

purgeFileInterval = 30 * time.Second
Expand Down
5 changes: 3 additions & 2 deletions tests/common/member_test.go
Expand Up @@ -196,7 +196,7 @@ func TestMemberRemove(t *testing.T) {
continue
}
t.Run(quorumTc.name+"/"+clusterTc.name, func(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 14*time.Second)
defer cancel()
c := clusterTc.config
c.StrictReconfigCheck = quorumTc.strictReconfigCheck
Expand All @@ -207,7 +207,8 @@ func TestMemberRemove(t *testing.T) {

testutils.ExecuteUntil(ctx, t, func() {
if quorumTc.waitForQuorum {
time.Sleep(etcdserver.HealthInterval)
// wait for health interval + leader election
time.Sleep(etcdserver.HealthInterval + 2*time.Second)
}

memberID, clusterID := memberToRemove(ctx, t, cc, c.ClusterSize)
Expand Down