fix panic 5435 (#5436)
This commit is contained in:
committed by
GitHub
parent
6aa804b368
commit
df40908e57
@@ -301,7 +301,7 @@ func (vl *VolumeLayout) PickForWrite(count uint64, option *VolumeGrowOption) (vi
|
||||
if float64(info.Size) > float64(vl.volumeSizeLimit)*option.Threshold() {
|
||||
shouldGrow = true
|
||||
}
|
||||
return vid, count, locationList, shouldGrow, nil
|
||||
return vid, count, locationList.Copy(), shouldGrow, nil
|
||||
}
|
||||
return 0, 0, nil, shouldGrow, errors.New("Strangely vid " + vid.String() + " is on no machine!")
|
||||
}
|
||||
|
||||
@@ -28,6 +28,9 @@ func (dnll *VolumeLocationList) Copy() *VolumeLocationList {
|
||||
|
||||
func (dnll *VolumeLocationList) Head() *DataNode {
|
||||
//mark first node as master volume
|
||||
if dnll.Length() == 0 {
|
||||
return nil
|
||||
}
|
||||
return dnll.list[0]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user