diff --git a/unmaintained/diff_volume_servers/diff_volume_servers.go b/unmaintained/diff_volume_servers/diff_volume_servers.go index 339d9c335..4de864980 100644 --- a/unmaintained/diff_volume_servers/diff_volume_servers.go +++ b/unmaintained/diff_volume_servers/diff_volume_servers.go @@ -155,7 +155,7 @@ func getVolumeFiles(v uint32, addr string) (map[types.NeedleId]needleState, int6 var maxOffset int64 files := map[types.NeedleId]needleState{} err = idx.WalkIndexFile(idxFile, func(key types.NeedleId, offset types.Offset, size types.Size) error { - if offset.IsZero() || size < 0 || size == types.TombstoneFileSize { + if offset.IsZero() || size.IsDeleted() { files[key] = needleState{ state: stateDeleted, size: size, diff --git a/weed/server/volume_grpc_erasure_coding.go b/weed/server/volume_grpc_erasure_coding.go index 79348c9d7..55e0261c8 100644 --- a/weed/server/volume_grpc_erasure_coding.go +++ b/weed/server/volume_grpc_erasure_coding.go @@ -272,7 +272,7 @@ func (vs *VolumeServer) VolumeEcShardRead(req *volume_server_pb.VolumeEcShardRea if req.FileKey != 0 { _, size, _ := ecVolume.FindNeedleFromEcx(types.Uint64ToNeedleId(req.FileKey)) - if size == types.TombstoneFileSize { + if size.IsDeleted() { return stream.Send(&volume_server_pb.VolumeEcShardReadResponse{ IsDeleted: true, }) @@ -340,7 +340,7 @@ func (vs *VolumeServer) VolumeEcBlobDelete(ctx context.Context, req *volume_serv if err != nil { return nil, fmt.Errorf("locate in local ec volume: %v", err) } - if size == types.TombstoneFileSize { + if size.IsDeleted() { return resp, nil } diff --git a/weed/storage/erasure_coding/ec_decoder.go b/weed/storage/erasure_coding/ec_decoder.go index 6793faca5..795a7d523 100644 --- a/weed/storage/erasure_coding/ec_decoder.go +++ b/weed/storage/erasure_coding/ec_decoder.go @@ -54,7 +54,7 @@ func FindDatFileSize(baseFileName string) (datSize int64, err error) { err = iterateEcxFile(baseFileName, func(key types.NeedleId, offset types.Offset, size types.Size) error { - if size == types.TombstoneFileSize { + if size.IsDeleted() { return nil } diff --git a/weed/storage/store_ec.go b/weed/storage/store_ec.go index 2b0df439c..8b4388519 100644 --- a/weed/storage/store_ec.go +++ b/weed/storage/store_ec.go @@ -124,7 +124,7 @@ func (s *Store) ReadEcShardNeedle(vid needle.VolumeId, n *needle.Needle) (int, e if err != nil { return 0, fmt.Errorf("locate in local ec volume: %v", err) } - if size == types.TombstoneFileSize { + if size.IsDeleted() { return 0, fmt.Errorf("entry %s is deleted", n.Id) }