@@ -42,7 +42,7 @@ func NewGRPCServer(store store.MVCCStore, coordinate *kv.Coordinate) *GRPCServer
4242func (r GRPCServer ) RawGet (ctx context.Context , req * pb.RawGetRequest ) (* pb.RawGetResponse , error ) {
4343 readTS := req .GetTs ()
4444 if readTS == 0 {
45- readTS = snapshotTS (r .coordinator .Clock ())
45+ readTS = snapshotTS (r .coordinator .Clock (), r . store )
4646 }
4747
4848 if r .coordinator .IsLeader () {
@@ -98,7 +98,7 @@ func (r GRPCServer) tryLeaderGet(key []byte) ([]byte, error) {
9898 defer conn .Close ()
9999
100100 cli := pb .NewRawKVClient (conn )
101- ts := snapshotTS (r .coordinator .Clock ())
101+ ts := snapshotTS (r .coordinator .Clock (), r . store )
102102 resp , err := cli .RawGet (context .Background (), & pb.RawGetRequest {Key : key , Ts : ts })
103103 if err != nil {
104104 return nil , errors .WithStack (err )
@@ -186,7 +186,7 @@ func (r GRPCServer) Get(ctx context.Context, req *pb.GetRequest) (*pb.GetRespons
186186 return nil , errors .WithStack (err )
187187 }
188188
189- readTS := snapshotTS (r .coordinator .Clock ())
189+ readTS := snapshotTS (r .coordinator .Clock (), r . store )
190190 v , err := r .store .GetAt (ctx , req .Key , readTS )
191191 if err != nil {
192192 switch {
@@ -234,7 +234,7 @@ func (r GRPCServer) Scan(ctx context.Context, req *pb.ScanRequest) (*pb.ScanResp
234234 Kv : nil ,
235235 }, errors .WithStack (err )
236236 }
237- readTS := snapshotTS (r .coordinator .Clock ())
237+ readTS := snapshotTS (r .coordinator .Clock (), r . store )
238238 res , err := r .store .ScanAt (ctx , req .StartKey , req .EndKey , limit , readTS )
239239 if err != nil {
240240 return & pb.ScanResponse {
0 commit comments