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
fix(volume): write state.pb into a real dir when -dir.idx is unset (#9178)
Chris Lu45ba71a18993
diff --git a/weed/storage/store.go b/weed/storage/store.goindex 43d3abf295..09bc6dd65f 100644--- a/weed/storage/store.go+++ b/weed/storage/store.go@@ -154,8 +154,17 @@ func NewStore(}wg.Wait()+ // Resolve state.pb's directory via the first disk location so it inherits+ // the same `~` expansion and empty-idxFolder fallback used for .idx files,+ // and is never written as a relative path against the process CWD (#9173).+ stateDir := idxFolder+ if len(s.Locations) > 0 {+ stateDir = s.Locations[0].IdxDirectory+ } else if stateDir != "" {+ stateDir = util.ResolvePath(stateDir)+ }var err error- s.State, err = NewState(idxFolder)+ s.State, err = NewState(stateDir)if err != nil {glog.Fatalf("failed to resolve state for volume %s: %v", id, err)}