Merge branch 'master' into support_ssd_volume
This commit is contained in:
@@ -163,7 +163,10 @@ func (dn *DataNode) GetVolumesById(id needle.VolumeId) (storage.VolumeInfo, erro
|
||||
}
|
||||
|
||||
func (dn *DataNode) GetDataCenter() *DataCenter {
|
||||
return dn.Parent().Parent().(*NodeImpl).value.(*DataCenter)
|
||||
rack := dn.Parent()
|
||||
dcNode := rack.Parent()
|
||||
dcValue := dcNode.GetValue()
|
||||
return dcValue.(*DataCenter)
|
||||
}
|
||||
|
||||
func (dn *DataNode) GetRack() *Rack {
|
||||
|
||||
@@ -220,7 +220,7 @@ func (vl *VolumeLayout) ensureCorrectWritables(vid needle.VolumeId) {
|
||||
|
||||
func (vl *VolumeLayout) isAllWritable(vid needle.VolumeId) bool {
|
||||
for _, dn := range vl.vid2location[vid].list {
|
||||
if v, found := dn.volumes[vid]; found {
|
||||
if v, getError := dn.GetVolumesById(vid); getError == nil {
|
||||
if v.ReadOnly {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user