diff options
| author | Chris Lu <chris.lu@gmail.com> | 2019-06-05 23:20:26 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2019-06-05 23:20:26 -0700 |
| commit | d344e0a035985ce7a28a6f7a4499199ef27aeda3 (patch) | |
| tree | 77f094232aab9c2e767adb05f81c4e7a9453c2e2 /weed/topology/topology.go | |
| parent | 450f4733cec38ec31c66b296749e2d0b14e91218 (diff) | |
| download | seaweedfs-d344e0a035985ce7a28a6f7a4499199ef27aeda3.tar.xz seaweedfs-d344e0a035985ce7a28a6f7a4499199ef27aeda3.zip | |
fix ec related bugs
Diffstat (limited to 'weed/topology/topology.go')
| -rw-r--r-- | weed/topology/topology.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/weed/topology/topology.go b/weed/topology/topology.go index c6fdd3861..aa01190c9 100644 --- a/weed/topology/topology.go +++ b/weed/topology/topology.go @@ -78,7 +78,7 @@ func (t *Topology) Leader() (string, error) { return l, nil } -func (t *Topology) Lookup(collection string, vid needle.VolumeId) []*DataNode { +func (t *Topology) Lookup(collection string, vid needle.VolumeId) (dataNodes []*DataNode) { //maybe an issue if lots of collections? if collection == "" { for _, c := range t.collectionMap.Items() { @@ -91,6 +91,14 @@ func (t *Topology) Lookup(collection string, vid needle.VolumeId) []*DataNode { return c.(*Collection).Lookup(vid) } } + + if locations, found := t.LookupEcShards(vid); found { + for _, loc := range locations.Locations { + dataNodes = append(dataNodes, loc...) + } + return dataNodes + } + return nil } |
