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 for issue #35
Chris Lu123b0cc2dfe3
diff --git a/go/storage/store.go b/go/storage/store.goindex fcb9ce41cb..a96602ed0b 100644--- a/go/storage/store.go+++ b/go/storage/store.go@@ -90,14 +90,18 @@ func (s *Store) findFreeLocation() (ret *DiskLocation) {}return ret}-func (s *Store) addVolume(vid VolumeId, replicationType ReplicationType) (err error) {+func (s *Store) addVolume(vid VolumeId, replicationType ReplicationType) error {if s.findVolume(vid) != nil {return fmt.Errorf("Volume Id %s already exists!", vid)}if location := s.findFreeLocation(); location != nil {log.Println("In dir", location.directory, "adds volume =", vid, ", replicationType =", replicationType)- location.volumes[vid], err = NewVolume(location.directory, vid, replicationType)- return err+ if volume, err := NewVolume(location.directory, vid, replicationType); err == nil {+ location.volumes[vid] = volume+ return nil+ } else {+ return err+ }}return fmt.Errorf("No more free space left")}