aboutsummaryrefslogtreecommitdiff
path: root/weed/wdclient/masterclient.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-07-21 23:49:51 -0700
committerchrislu <chris.lu@gmail.com>2022-07-21 23:49:51 -0700
commit35261c805efe56a05ae524b798e0158719cf7a04 (patch)
tree563e07fbe996a9ed54e600ffb306f22552d628d6 /weed/wdclient/masterclient.go
parent99739fa5a9c20174a1739e51d3a8b4c4d2ebd3b1 (diff)
parent7a6c559ab4a6b696bb574454b297ebefabec29ed (diff)
downloadseaweedfs-35261c805efe56a05ae524b798e0158719cf7a04.tar.xz
seaweedfs-35261c805efe56a05ae524b798e0158719cf7a04.zip
Merge branch 'master' into messaging
Diffstat (limited to 'weed/wdclient/masterclient.go')
-rw-r--r--weed/wdclient/masterclient.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/weed/wdclient/masterclient.go b/weed/wdclient/masterclient.go
index 667549686..e11d71889 100644
--- a/weed/wdclient/masterclient.go
+++ b/weed/wdclient/masterclient.go
@@ -2,6 +2,7 @@ package wdclient
import (
"context"
+ "fmt"
"github.com/chrislusf/seaweedfs/weed/stats"
"math/rand"
"time"
@@ -46,7 +47,7 @@ func (mc *MasterClient) GetLookupFileIdFunction() LookupFileIdFunctionType {
func (mc *MasterClient) LookupFileIdWithFallback(fileId string) (fullUrls []string, err error) {
fullUrls, err = mc.vidMap.LookupFileId(fileId)
- if err == nil {
+ if err == nil && len(fullUrls) > 0 {
return
}
err = pb.WithMasterClient(false, mc.currentMaster, mc.grpcDialOption, func(client master_pb.SeaweedClient) error {
@@ -54,7 +55,7 @@ func (mc *MasterClient) LookupFileIdWithFallback(fileId string) (fullUrls []stri
VolumeOrFileIds: []string{fileId},
})
if err != nil {
- return err
+ return fmt.Errorf("LookupVolume failed: %v", err)
}
for vid, vidLocation := range resp.VolumeIdLocations {
for _, vidLoc := range vidLocation.Locations {
@@ -67,7 +68,6 @@ func (mc *MasterClient) LookupFileIdWithFallback(fileId string) (fullUrls []stri
fullUrls = append(fullUrls, "http://"+loc.Url+"/"+fileId)
}
}
-
return nil
})
return