Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

filer.copy: fail early if assign request failed

Chris Lu5c14da0f1efb
diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go
index 97f1517cd6..722f646791 100644
--- a/weed/command/filer_copy.go
+++ b/weed/command/filer_copy.go
@@ -381,6 +381,9 @@ func (worker *FileCopyWorker) uploadFileAsOne(task FileCopyTask, f *os.File) err
if assignResult.Error != "" {
return fmt.Errorf("assign volume failure %v: %v", request, assignResult.Error)
}
+ if assignResult.Url == "" {
+ return fmt.Errorf("assign volume failure %v: %v", request, assignResult)
+ }
return nil
})
})
diff --git a/weed/operation/assign_file_id.go b/weed/operation/assign_file_id.go
index ffd3e4938f..fabc820ff4 100644
--- a/weed/operation/assign_file_id.go
+++ b/weed/operation/assign_file_id.go
@@ -73,6 +73,10 @@ func Assign(masterFn GetMasterFn, grpcDialOption grpc.DialOption, primaryRequest
ret.Error = resp.Error
ret.Auth = security.EncodedJwt(resp.Auth)
+ if resp.Error != "" {
+ return fmt.Errorf("assignRequest: %v", resp.Error)
+ }
+
return nil
})