Konstantin Lebedev
9 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
9 additions and
4 deletions
-
weed/topology/volume_layout.go
|
|
@ -234,13 +234,18 @@ func (vl *VolumeLayout) ensureCorrectWritables(vid needle.VolumeId) { |
|
|
|
} |
|
|
|
|
|
|
|
func (vl *VolumeLayout) isAllWritable(vid needle.VolumeId) bool { |
|
|
|
for _, dn := range vl.vid2location[vid].list { |
|
|
|
if v, getError := dn.GetVolumesById(vid); getError == nil { |
|
|
|
if v.ReadOnly { |
|
|
|
return false |
|
|
|
if location, ok := vl.vid2location[vid]; ok { |
|
|
|
for _, dn := range location.list { |
|
|
|
if v, getError := dn.GetVolumesById(vid); getError == nil { |
|
|
|
if v.ReadOnly { |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
return true |
|
|
|
} |
|
|
|
|
|
|
|