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.

find location with matching disk type

Chris Lu933f2f4cfdfa
diff --git a/weed/storage/store.go b/weed/storage/store.go
index b7e439ad3c..8351ecf3b0 100644
--- a/weed/storage/store.go
+++ b/weed/storage/store.go
@@ -103,6 +103,9 @@ func (s *Store) findVolume(vid needle.VolumeId) *Volume {
func (s *Store) FindFreeLocation(diskType DiskType) (ret *DiskLocation) {
max := 0
for _, location := range s.Locations {
+ if diskType != location.DiskType {
+ continue
+ }
currentFreeCount := location.MaxVolumeCount - location.VolumesLen()
currentFreeCount *= erasure_coding.DataShardsCount
currentFreeCount -= location.EcVolumesLen()