diff --git a/weed/server/volume_grpc_batch_delete.go b/weed/server/volume_grpc_batch_delete.go index 8deb96a80..db67ae9f5 100644 --- a/weed/server/volume_grpc_batch_delete.go +++ b/weed/server/volume_grpc_batch_delete.go @@ -87,6 +87,11 @@ func (vs *VolumeServer) BatchDelete(ctx context.Context, req *volume_server_pb.B Status: http.StatusInternalServerError, Error: err.Error()}, ) + } else if size == 0 { + resp.Results = append(resp.Results, &volume_server_pb.DeleteResult{ + FileId: fid, + Status: http.StatusNotModified}, + ) } else { resp.Results = append(resp.Results, &volume_server_pb.DeleteResult{ FileId: fid, diff --git a/weed/shell/command_volume_check_disk.go b/weed/shell/command_volume_check_disk.go index ae790a418..3e2512bdd 100644 --- a/weed/shell/command_volume_check_disk.go +++ b/weed/shell/command_volume_check_disk.go @@ -271,7 +271,7 @@ func doVolumeCheckDisk(minuend, subtrahend *needle_map.MemDb, source, target *Vo } - if doSyncDeletions && len(partiallyDeletedNeedles) > 0 { + if doSyncDeletions && applyChanges && len(partiallyDeletedNeedles) > 0 { var fidList []string for _, needleValue := range partiallyDeletedNeedles { fidList = append(fidList, needleValue.Key.FileId(source.info.Id)) @@ -286,7 +286,7 @@ func doVolumeCheckDisk(minuend, subtrahend *needle_map.MemDb, source, target *Vo return hasChanges, deleteErr } for _, deleteResult := range deleteResults { - if deleteResult.Status == http.StatusAccepted { + if deleteResult.Status == http.StatusAccepted && deleteResult.Size > 0 { hasChanges = true return }