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.

In case lastNode==0, need to set it to -1

chrislusf418878edce06
diff --git a/go/storage/store.go b/go/storage/store.go
index 425675c8b6..b37175f11c 100644
--- a/go/storage/store.go
+++ b/go/storage/store.go
@@ -44,9 +44,9 @@ func NewMasterNodes(bootstrapNode string) (mn *MasterNodes) {
}
func (mn *MasterNodes) reset() {
glog.V(4).Infof("Resetting master nodes: %v", mn)
- if len(mn.nodes) > 1 && mn.lastNode > 0 {
+ if len(mn.nodes) > 1 && mn.lastNode >= 0 {
glog.V(0).Infof("Reset master %s from: %v", mn.nodes[mn.lastNode], mn.nodes)
- mn.lastNode = -mn.lastNode
+ mn.lastNode = -mn.lastNode - 1
}
}
func (mn *MasterNodes) findMaster() (string, error) {