[voluche.chek.disk] needles older than the cutoff time are not missing yet (#3922)

needles older than the cutoff time are not missing yet

https://github.com/seaweedfs/seaweedfs/issues/3919
This commit is contained in:
Konstantin Lebedev
2022-10-29 00:12:20 +05:00
committed by GitHub
parent f9f499b8d5
commit 764d9cb105
3 changed files with 78 additions and 13 deletions

View File

@@ -1,7 +1,11 @@
package shell
import (
"context"
"fmt"
"github.com/seaweedfs/seaweedfs/weed/operation"
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
"github.com/seaweedfs/seaweedfs/weed/storage/needle_map"
"io"
"net/url"
"strconv"
@@ -148,3 +152,20 @@ func findInputDirectory(args []string) (input string) {
}
return input
}
func readNeedleMeta(grpcDialOption grpc.DialOption, volumeServer pb.ServerAddress, volumeId uint32, needleValue needle_map.NeedleValue) (resp *volume_server_pb.ReadNeedleMetaResponse, err error) {
err = operation.WithVolumeServerClient(false, volumeServer, grpcDialOption,
func(client volume_server_pb.VolumeServerClient) error {
if resp, err = client.ReadNeedleMeta(context.Background(), &volume_server_pb.ReadNeedleMetaRequest{
VolumeId: volumeId,
NeedleId: uint64(needleValue.Key),
Offset: needleValue.Offset.ToActualOffset(),
Size: int32(needleValue.Size),
}); err != nil {
return err
}
return nil
},
)
return
}