Open andylokandy opened 2 years ago
Is anyone requesting for the features?
@BusyJay Do you think the technical approach is appropriate?
There is a stale read already. I think this is just a implement details of stale read in RawKV. Without knowing the detail background, it's hard to say if it's the right solution, even though it can work in some way.
@BusyJay IMO, replica read and stale read are also somehow similar, but still we gave them different names. Besides, the name in kvproto is also implementation detail, and we can hide these complexity in the client.
One more point: user will not read back different values from the different servers when using replica_read
or stale_read
while dirty_read
will.
replica read and stale read are also somehow similar, but still we gave them different names
Replica read should not break learnability. Stale read can read whenever ACID is hold for transaction, and can read arbitrary data for raw kv. dirty
is meaningless in raw kv as there is no transactions at all.
user will not read back different values from the different servers when using
replica_read
orstale_read
Nothing can prevent replica_read
or stale_read
to return different values for raw KV from different servers at different time. Repeated read is a property of transaction kv.
I've posted an RFC: https://github.com/tikv/rfcs/pull/80
Feature Request
Background
Follower read (aka. replica read) allows the follower to respond to read requests. To achieve that without breaking strong consistency guarantee, the follower will proxy a special read request (called read index) to the leader, to which the leader will not respond the data, and after receiving the response from the leader, the follower will read data from the local replica and respond to the client.
Describe the feature you'd like:
Eventually consistency is acceptable in some scenarios when using RawKV, thus to achieve this, the follower will be allowed to read the local replica without informing the leader.
Technical proposal
Add a bool field
raw_stale_read
tokvrpcpb.Context
andraft_cmdpb.RaftRequestHeader
. Then check theraw_stale_read
field inRequestInspector::inspect()
which is incomponents/raftstore/src/store/peer.rs
and returnRequestPolicy::ReadLocal
ifraw_stale_read
is set.