Browse Source

return error

pull/7411/head
chrislu 1 month ago
parent
commit
5737f77d5f
  1. 7
      weed/server/filer_grpc_server.go

7
weed/server/filer_grpc_server.go

@ -96,19 +96,16 @@ func (fs *FilerServer) LookupVolume(ctx context.Context, req *filer_pb.LookupVol
// Use master client's lookup with fallback - it handles cache and master query // Use master client's lookup with fallback - it handles cache and master query
vidLocations, err := fs.filer.MasterClient.LookupVolumeIdsWithFallback(ctx, req.VolumeIds) vidLocations, err := fs.filer.MasterClient.LookupVolumeIdsWithFallback(ctx, req.VolumeIds)
if err != nil {
// Return partial results even on error
glog.V(0).InfofCtx(ctx, "failed to lookup some volumes: %v", err)
}
// Convert wdclient.Location to filer_pb.Location // Convert wdclient.Location to filer_pb.Location
// Return partial results even if there was an error
for vidString, locations := range vidLocations { for vidString, locations := range vidLocations {
resp.LocationsMap[vidString] = &filer_pb.Locations{ resp.LocationsMap[vidString] = &filer_pb.Locations{
Locations: wdclientLocationsToPb(locations), Locations: wdclientLocationsToPb(locations),
} }
} }
return resp, nil
return resp, err
} }
func wdclientLocationsToPb(locations []wdclient.Location) []*filer_pb.Location { func wdclientLocationsToPb(locations []wdclient.Location) []*filer_pb.Location {

Loading…
Cancel
Save