Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

add validate config for raft (#4332)

Konstantin Lebedevde4545c28b82
diff --git a/weed/server/raft_hashicorp.go b/weed/server/raft_hashicorp.go
index 76468b5e17..d06066b934 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))