rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

Stale read for rawkv with read ts

Open iosmanthus opened this issue 3 years ago • 3 comments

Signed-off-by: iosmanthus [email protected]

This pull request is based on the https://github.com/tikv/rfcs/pull/80.

Rendered

iosmanthus avatar Jun 07 '22 11:06 iosmanthus

There is a special case that user may choose availability rather than consistency. So client is OK to read with any ts, that is just return what the replica has currently. In this RFC, it seems keys with larger ts may be skipped during read.

BusyJay avatar Aug 31 '22 06:08 BusyJay

There is a special case that user may choose availability rather than consistency. So client is OK to read with any ts, that is just return what the replica has currently. In this RFC, it seems keys with larger ts may be skipped during read.

This RFC doesn't depend on the keys' timestamp, the underlying storage could have no information about the timestamp. The safe_ts is like the (approximate) timestamp of the leader that writes the key. The read_ts tends to be checked against the safe_ts to guarantee the replicas have already been synced with those writes that happened around safe_ts. To read any data, we could specify the read_ts to 0, and then any replicas with safe_ts > 0 could handle the request.

iosmanthus avatar Aug 31 '22 17:08 iosmanthus

I'm OK with 0 timestamp. Currently, txn stale read consider ts 0 an error. And client (like TiDB) may actually send ts 0 by mistake. This RFC should state clear what 0 means in rawkv and implementation should not break compatibility.

BusyJay avatar Sep 01 '22 02:09 BusyJay