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
onPeerUpdateGoroutineCount use int32
Konstantin Lebedev7875470e7402
diff --git a/weed/server/master_server.go b/weed/server/master_server.goindex 7f9bff3892..98fb6aab12 100644--- a/weed/server/master_server.go+++ b/weed/server/master_server.go@@ -67,7 +67,7 @@ type MasterServer struct {boundedLeaderChan chan intonPeerUpdateDoneCn chan string- onPeerUpdateGoroutineCount uint32+ onPeerUpdateGoroutineCount int32// notifying clientsclientChansLock sync.RWMutex@@ -367,16 +367,16 @@ func (ms *MasterServer) OnPeerUpdate(update *master_pb.ClusterNodeUpdate, startFhashicorpRaft.ServerAddress(peerAddress.ToGrpcAddress()), 0, 0)}}- if atomic.LoadUint32(&ms.onPeerUpdateGoroutineCount) > 0 {+ if atomic.LoadInt32(&ms.onPeerUpdateGoroutineCount) > 0 {ms.onPeerUpdateDoneCn <- peerName}} else if isLeader {go func(peerName string) {raftServerRemovalTimeAfter := time.After(RaftServerRemovalTime)raftServerPingTicker := time.NewTicker(5 * time.Minute)- atomic.AddUint32(&ms.onPeerUpdateGoroutineCount, 1)+ atomic.AddInt32(&ms.onPeerUpdateGoroutineCount, 1)defer func() {- atomic.AddUint32(&ms.onPeerUpdateGoroutineCount, -1)+ atomic.AddInt32(&ms.onPeerUpdateGoroutineCount, -1)}()for {select {