Browse Source

fix a data race bug

pull/279/head
tnextday 10 years ago
parent
commit
891380374a
  1. 2
      weed/topology/volume_layout.go

2
weed/topology/volume_layout.go

@ -115,7 +115,7 @@ func (vl *VolumeLayout) PickForWrite(count uint64, option *VolumeGrowOption) (*s
vid := vl.writables[rand.Intn(len_writers)] vid := vl.writables[rand.Intn(len_writers)]
locationList := vl.vid2location[vid] locationList := vl.vid2location[vid]
if locationList != nil { if locationList != nil {
return &vid, count, locationList, nil
return &vid, count, locationList.Duplicate(), nil
} }
return nil, 0, nil, errors.New("Strangely vid " + vid.String() + " is on no machine!") return nil, 0, nil, errors.New("Strangely vid " + vid.String() + " is on no machine!")
} }

Loading…
Cancel
Save