mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-22 14:32:35 +00:00
topology: return a copy from VolumeLayout.Lookup
Callers iterating the returned slice raced with registrations and removals replacing the location list in place.
This commit is contained in:
@@ -591,7 +591,7 @@ func (vl *VolumeLayout) Lookup(vid needle.VolumeId) []*DataNode {
|
||||
defer vl.accessLock.RUnlock()
|
||||
|
||||
if location := vl.vid2location[vid]; location != nil {
|
||||
return location.list
|
||||
return append([]*DataNode(nil), location.list...)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user