From de4545c28b8283fb80ae03dc95910a0ab3a67142 Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> Date: Tue, 21 Mar 2023 18:36:13 +0500 Subject: [PATCH] add validate config for raft (#4332) --- weed/server/raft_hashicorp.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed/server/raft_hashicorp.go b/weed/server/raft_hashicorp.go index 76468b5e1..d06066b93 100644 --- a/weed/server/raft_hashicorp.go +++ b/weed/server/raft_hashicorp.go @@ -121,6 +121,10 @@ func NewHashicorpRaftServer(option *RaftServerOption) (*RaftServer, error) { c.LogLevel = "Error" } + if err := raft.ValidateConfig(c); err != nil { + return nil, fmt.Errorf(`raft.ValidateConfig: %v`, err) + } + if option.RaftBootstrap { os.RemoveAll(path.Join(s.dataDir, ldbFile)) os.RemoveAll(path.Join(s.dataDir, sdbFile))