mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-19 14:47:57 +08:00
fix leader master /dir/lookup api
Signed-off-by: Lei Liu <lei01.liu@horizon.ai>
This commit is contained in:
@@ -65,11 +65,17 @@ func (ms *MasterServer) findVolumeLocation(collection, vid string) operation.Loo
|
||||
var err error
|
||||
if ms.Topo.IsLeader() {
|
||||
volumeId, newVolumeIdErr := needle.NewVolumeId(vid)
|
||||
machines := ms.Topo.Lookup(collection, volumeId)
|
||||
for _, loc := range machines {
|
||||
locations = append(locations, operation.Location{Url: loc.Url(), PublicUrl: loc.PublicUrl})
|
||||
if newVolumeIdErr != nil {
|
||||
err = fmt.Errorf("Unknown volume id %s", vid)
|
||||
} else {
|
||||
machines := ms.Topo.Lookup(collection, volumeId)
|
||||
for _, loc := range machines {
|
||||
locations = append(locations, operation.Location{Url: loc.Url(), PublicUrl: loc.PublicUrl})
|
||||
}
|
||||
if locations == nil {
|
||||
err = fmt.Errorf("volume id %s not found", vid)
|
||||
}
|
||||
}
|
||||
err = newVolumeIdErr
|
||||
} else {
|
||||
machines, getVidLocationsErr := ms.MasterClient.GetVidLocations(vid)
|
||||
for _, loc := range machines {
|
||||
|
Reference in New Issue
Block a user