aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryulai.li <blacktear23@gmail.com>2022-06-26 22:44:01 +0800
committeryulai.li <blacktear23@gmail.com>2022-06-26 22:44:01 +0800
commit13159ad0d888c57901f405e1f883ed64101a637a (patch)
treeaf5d99b8ee8262081530e143e01edcb98254bf96
parent46e0b629e529f3aff535f90dd25eb719adf1c0d0 (diff)
parentf77eda4b4f0aed61ce7d8e8abfdc5bd8f2ec786a (diff)
downloadseaweedfs-13159ad0d888c57901f405e1f883ed64101a637a.tar.xz
seaweedfs-13159ad0d888c57901f405e1f883ed64101a637a.zip
Merge branch 'master' into filerstore-tikv
-rw-r--r--weed/wdclient/masterclient.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/wdclient/masterclient.go b/weed/wdclient/masterclient.go
index def4a9a71..fb681b523 100644
--- a/weed/wdclient/masterclient.go
+++ b/weed/wdclient/masterclient.go
@@ -44,6 +44,9 @@ func (mc *MasterClient) GetLookupFileIdFunction() LookupFileIdFunctionType {
func (mc *MasterClient) LookupFileIdWithFallback(fileId string) (fullUrls []string, err error) {
fullUrls, err = mc.vidMap.LookupFileId(fileId)
+ if err == nil {
+ return
+ }
err = pb.WithMasterClient(false, mc.currentMaster, mc.grpcDialOption, func(client master_pb.SeaweedClient) error {
resp, err := client.LookupVolume(context.Background(), &master_pb.LookupVolumeRequest{
VolumeOrFileIds: []string{fileId},
@@ -59,7 +62,7 @@ func (mc *MasterClient) LookupFileIdWithFallback(fileId string) (fullUrls []stri
GrpcPort: int(vidLoc.GrpcPort),
}
mc.vidMap.addLocation(uint32(vid), loc)
- fullUrls = append(fullUrls, loc.Url)
+ fullUrls = append(fullUrls, "http://"+loc.Url+"/"+fileId)
}
}