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.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
randomize raft server startup
Chris Lu75d63db60d16
diff --git a/weed/command/benchmark.go b/weed/command/benchmark.goindex 4ba00dc983..8b65c86637 100644--- a/weed/command/benchmark.go+++ b/weed/command/benchmark.go@@ -2,6 +2,7 @@ package commandimport ("bufio"+ "context""fmt""io""math"@@ -19,7 +20,6 @@ import ("github.com/chrislusf/seaweedfs/weed/security""github.com/chrislusf/seaweedfs/weed/util""github.com/chrislusf/seaweedfs/weed/wdclient"- "context")type BenchmarkOptions struct {diff --git a/weed/command/master.go b/weed/command/master.goindex ac5902b60d..34f467bd2c 100644--- a/weed/command/master.go+++ b/weed/command/master.go@@ -132,7 +132,7 @@ func checkPeers(masterIp string, masterPort int, peers string) (masterAddress stif !hasSelf {peerCount += 1}- if peerCount %2 == 0 {+ if peerCount%2 == 0 {glog.Fatalf("Only odd number of masters are supported!")}returndiff --git a/weed/server/filer_ui/templates.go b/weed/server/filer_ui/templates.goindex e53d5caa7e..c2d69156e6 100644--- a/weed/server/filer_ui/templates.go+++ b/weed/server/filer_ui/templates.go@@ -1,8 +1,8 @@package master_uiimport (- "html/template""github.com/dustin/go-humanize"+ "html/template")var funcMap = template.FuncMap{diff --git a/weed/server/raft_server.go b/weed/server/raft_server.goindex e2a091e83b..01ca41aac1 100644--- a/weed/server/raft_server.go+++ b/weed/server/raft_server.go@@ -3,6 +3,7 @@ package weed_serverimport ("encoding/json""io/ioutil"+ "math/rand""os""path""reflect"@@ -68,7 +69,7 @@ func NewRaftServer(r *mux.Router, peers []string, httpAddr string, dataDir strinfor _, peer := range s.peers {s.raftServer.AddPeer(peer, "http://"+peer)}- time.Sleep(2 * time.Second)+ time.Sleep(time.Duration(1000+rand.Int31n(3000)) * time.Millisecond)if s.raftServer.IsLogEmpty() {// Initialize the server by joining itself.glog.V(0).Infoln("Initializing new cluster")diff --git a/weed/storage/types/needle_id_128bit.go b/weed/storage/types/needle_id_128bit.goindex 8f1c50a295..3af0b72856 100644--- a/weed/storage/types/needle_id_128bit.go+++ b/weed/storage/types/needle_id_128bit.go@@ -7,7 +7,7 @@ import ()const (- NeedleIdSize = 16+ NeedleIdSize = 16NeedleIdEmpty = "")diff --git a/weed/storage/types/needle_id_type.go b/weed/storage/types/needle_id_type.goindex 78a493b943..efb22190d6 100644--- a/weed/storage/types/needle_id_type.go+++ b/weed/storage/types/needle_id_type.go@@ -11,7 +11,7 @@ import (type NeedleId uint64const (- NeedleIdSize = 8+ NeedleIdSize = 8NeedleIdEmpty = 0)