diff --git a/weed/server/filer_grpc_server_remote.go b/weed/server/filer_grpc_server_remote.go index e790a12ef..3174c4206 100644 --- a/weed/server/filer_grpc_server_remote.go +++ b/weed/server/filer_grpc_server_remote.go @@ -241,6 +241,12 @@ func (fs *FilerServer) doCacheRemoteObjectToLocalCluster(ctx context.Context, re }) chunksMu.Unlock() if err != nil { + // Clean up any chunks that were successfully written before the error. + // Without this, partial downloads leave orphaned needles in volume servers + // that accumulate across retry cycles and cannot be reclaimed by vacuum. + if len(chunks) > 0 { + fs.filer.DeleteUncommittedChunks(ctx, chunks) + } return nil, err }