-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Flush and BufferGet requests for pipelined DML #1218
Conversation
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
83e2d9d
to
84c879f
Compare
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
Need to rebase master, I cannot build the latest TiDB with this PR because some protocols are missing. |
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
Signed-off-by: ekexium <[email protected]>
message BufferBatchGetRequest { | ||
Context context = 1; | ||
repeated bytes keys = 2; | ||
uint64 version = 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we add a variable to control whether enable snapshot read after buffer read miss? This may save one RPC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A similar question, if it's designed to support both buffer-read and snapshot read, or do we need another interface to implement "UnionStoreBatchGet" at tikv side?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we add a variable to control whether enable snapshot read after buffer read miss? This may save one RPC.
We can do it later when we are about to implement this. We don't have to finalize all details in one PR.
A similar question, if it's designed to support both buffer-read and snapshot read, or do we need another interface to implement "UnionStoreBatchGet" at tikv side?
BufferBatchGet
only serves buffer read. Its semantics is "reading the content offloaded to TiKV in the membuffer"
Snapshot read does not change.
Something like UnionStoreBatchGet
is not needed for now(before we implement the optimization to save one RPC), as unionstore.get
is simply implemented as "buffer.get, if not found, try snapshot.get". This implementation does not have to change at all.
The only thing we need to change is how we do buffer read. Does that sound straightforward and reasonable?
Previous:
membuffer.get = memdb.get
snapshot.get = tikv.get
unionstore.get = membuffer.get +? snapshot.get = memdb.get +? tikv.get
Now:
membuffer.get = mutable_memdb.get +? immutable_memdb.get +? tikv.buffer_batch_get
snapshot.get = tikv.get
unionstore.get = membuffer.get +? snapshot.get = mutable_memdb.get +? immutable_memdb.get +? tikv.buffer_batch_get +? tikv.get
Another way for reading a transaction's own uncommitted data in tikv:
So we could avoid introducing the |
So the only difference is in the grpc level, whether to use 3 different RPCs for snapshot read, buffer read, and union read; or use one RPC for all of them and use flags to differentiate. Seems a trade-off between interface simplicity and clarity. Imagine when we see a |
We essentially need to support one RPC to complete the membuf read + snapshot read, regardless of whether or not a separate KV interface is split out. This scalability needs to be reserved. |
@MyonKeminta PTAL |
I agree with this. We can regard it as an RPC interface that supports reading with the buffer, including buffer reading only and mixed (union) reading. But my problem is whether the word "buffer" is proper here... |
@MyonKeminta any suggestions on names? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using the word "staged"?
..And maybe i'd better approve this PR for now as I don't have any better idea...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Ref tikv/tikv#16291
Don't merge it until corresponding work finishes.