aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2025-10-30 17:19:07 -0700
committerchrislu <chris.lu@gmail.com>2025-10-30 17:19:07 -0700
commit3be91b212569e8ad99e39f6e5bf26fba7316dc1c (patch)
treeb49c648112aaf88273289e3203ddd24eeec6b6d9
parentd9e19cc49bc5cc0fd81d544d4f8aa68bec5eb5f0 (diff)
downloadseaweedfs-3be91b212569e8ad99e39f6e5bf26fba7316dc1c.tar.xz
seaweedfs-3be91b212569e8ad99e39f6e5bf26fba7316dc1c.zip
parsing
-rw-r--r--weed/server/filer_grpc_server.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/weed/server/filer_grpc_server.go b/weed/server/filer_grpc_server.go
index 6773717ec..c90cdb3e6 100644
--- a/weed/server/filer_grpc_server.go
+++ b/weed/server/filer_grpc_server.go
@@ -100,12 +100,12 @@ func (fs *FilerServer) LookupVolume(ctx context.Context, req *filer_pb.LookupVol
var vidsToLookup []string
for _, vidString := range req.VolumeIds {
- vid, err := strconv.Atoi(vidString)
+ vid, err := strconv.ParseUint(vidString, 10, 32)
if err != nil {
- glog.V(1).InfofCtx(ctx, "Unknown volume id %s", vidString)
+ glog.V(1).InfofCtx(ctx, "Invalid volume id (must be uint32): %s", vidString)
return nil, err
}
-
+
// Check cache first
locations, found := fs.filer.MasterClient.GetLocations(uint32(vid))
if found && len(locations) > 0 {
@@ -136,7 +136,7 @@ func (fs *FilerServer) LookupVolume(ctx context.Context, req *filer_pb.LookupVol
glog.V(0).InfofCtx(ctx, "volume %s lookup error: %s", vidLoc.VolumeOrFileId, vidLoc.Error)
continue
}
-
+
vidString := vidLoc.VolumeOrFileId
// Parse volume ID from response (could be "123" or "123,abc")
parts := strings.Split(vidString, ",")
@@ -151,7 +151,7 @@ func (fs *FilerServer) LookupVolume(ctx context.Context, req *filer_pb.LookupVol
}
return nil
})
-
+
if err != nil {
glog.V(0).InfofCtx(ctx, "failed to lookup volumes from master: %v", err)
// Don't return error, return partial results