aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-12-13 23:39:00 -0800
committerChris Lu <chris.lu@gmail.com>2020-12-13 23:39:00 -0800
commit933f2f4cfdfa9abd16f735abb6b83f00aabe83b3 (patch)
tree3c6062ef25cecdceae57fc8f679a0926430d2df4
parent94525aa0fdb8ecbb3f2adf1d9a04bb1572540700 (diff)
downloadseaweedfs-933f2f4cfdfa9abd16f735abb6b83f00aabe83b3.tar.xz
seaweedfs-933f2f4cfdfa9abd16f735abb6b83f00aabe83b3.zip
find location with matching disk type
-rw-r--r--weed/storage/store.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/storage/store.go b/weed/storage/store.go
index b7e439ad3..8351ecf3b 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()