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.

adjust weedc heartbeat to be randomly between (1*pulse, 2*pulse) seconds

[email protected]b2f4a4e7391c
diff --git a/weed-fs/src/cmd/weedc.go b/weed-fs/src/cmd/weedc.go
index 9336c17756..6d40b9586d 100644
--- a/weed-fs/src/cmd/weedc.go
+++ b/weed-fs/src/cmd/weedc.go
@@ -8,6 +8,7 @@ import (
"json"
"log"
"mime"
+ "rand"
"strconv"
"strings"
"time"
@@ -136,7 +137,8 @@ func main() {
go func() {
for {
store.Join(*metaServer)
- time.Sleep(int64(*pulse) * 1e9)
+ ns := int64(*pulse) * 1e9
+ time.Sleep(ns + rand.Int63()%ns)
}
}()
log.Println("store joined at", *metaServer)
diff --git a/weed-fs/src/cmd/weeds.go b/weed-fs/src/cmd/weeds.go
index 4eab3fe739..065813ae1c 100644
--- a/weed-fs/src/cmd/weeds.go
+++ b/weed-fs/src/cmd/weeds.go
@@ -43,7 +43,7 @@ func dirJoinHandler(w http.ResponseWriter, r *http.Request) {
publicUrl := r.FormValue("publicUrl")
volumes := new([]storage.VolumeInfo)
json.Unmarshal([]byte(r.FormValue("volumes")), volumes)
- log.Println("Recieved updates from", s, "volumes", r.FormValue("volumes"))
+ log.Println(s, "volumes", r.FormValue("volumes"))
mapper.Add(*directory.NewMachine(s, publicUrl, *volumes))
}
func dirStatusHandler(w http.ResponseWriter, r *http.Request) {