Browse Source

filer.copy: fail early if assign request failed

fix https://github.com/chrislusf/seaweedfs/issues/2216
pull/2218/head
Chris Lu 3 years ago
parent
commit
5c14da0f1e
  1. 3
      weed/command/filer_copy.go
  2. 4
      weed/operation/assign_file_id.go

3
weed/command/filer_copy.go

@ -381,6 +381,9 @@ func (worker *FileCopyWorker) uploadFileAsOne(task FileCopyTask, f *os.File) err
if assignResult.Error != "" { if assignResult.Error != "" {
return fmt.Errorf("assign volume failure %v: %v", request, 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 return nil
}) })
}) })

4
weed/operation/assign_file_id.go

@ -73,6 +73,10 @@ func Assign(masterFn GetMasterFn, grpcDialOption grpc.DialOption, primaryRequest
ret.Error = resp.Error ret.Error = resp.Error
ret.Auth = security.EncodedJwt(resp.Auth) ret.Auth = security.EncodedJwt(resp.Auth)
if resp.Error != "" {
return fmt.Errorf("assignRequest: %v", resp.Error)
}
return nil return nil
}) })

Loading…
Cancel
Save