forked from etcd-io/etcd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
etcdmain: Honour ExperimentalWaitClusterReadyTimeout in startEtcd
When we can't reach quorum, we were waiting forever and never sending the systemd notify message. As a result, systemd would eventually time out and restart the etcd process which likely would make the unhealthy cluster in an even worse state Improves etcd-io#13785 Signed-off-by: Nicolai Moore <niconorsk@gmail.com>
- Loading branch information
Showing
5 changed files
with
66 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright 2021 The etcd Authors | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package e2e | ||
|
||
import ( | ||
"testing" | ||
|
||
"go.etcd.io/etcd/tests/v3/framework/e2e" | ||
) | ||
|
||
func TestInitDaemonNotifyWithoutQuorum(t *testing.T) { | ||
// Initialize a cluster with 3 members | ||
epc, err := e2e.InitEtcdProcessCluster(t, e2e.NewConfigAutoTLS()) | ||
if err != nil { | ||
t.Fatalf("Failed to initilize the etcd cluster: %v", err) | ||
} | ||
|
||
// Remove two members, so that only one etcd will get started | ||
epc.Procs = epc.Procs[:1] | ||
|
||
// Start the etcd cluster with only one member | ||
if err := epc.Start(); err != nil { | ||
t.Fatalf("Failed to start the etcd cluster: %v", err) | ||
} | ||
|
||
// Expect log message indicating systemd notify message has been sent | ||
e2e.ExpectLog(t, epc.Procs[0], "notifying init daemon") | ||
// Expect log message indicating time out waiting for quorum hit | ||
e2e.ExpectLog(t, epc.Procs[0], "startEtcd: timed out waiting for the ready notification") | ||
epc.Close() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters