-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
kv: buffered writes #72614
Comments
Problem 1. seems almost orthogonal. It seems like we could solve that with more code in the MVCC layer interacting with in-memory data structures. Problem 2 is legit and interesting. It comes with a cost. One thought I've had on this front is that instead of buffering the write in the coordinator, we could send it to the leaseholder which could store it in memory and treat it as an upgrade lock as opposed to an exclusive lock. Then, before commit, we'd need to go and replicate. That'd help with the problems related to visibility and with coordinator RAM usage. It relates in implementation to 1.
All in all, my vote is that we do something about 1. and make a plan on #65726, leaving the rest for a later day. |
Any opposition to pulling 1 into its own issue? I think it's important and pretty independent? I was thinking about contention footprints after @irfansharif's talk and feel like whatever we do for #22349 / #41720 (comment) we might be able to use the same data structure for this. |
You see it as independent from the other points because it can be addressed with buffering on the leaseholder, as opposed to buffering on the client? |
First half of cockroachdb#71074. This commit replaces all client-side use of InitPut request with the equivalent use of CPut. It uses the following equivalence to perform this mapping: ``` InitPut(key, value) -> CPutAllowingIfNotExists(key, value, value) ``` A future change in v23.2 (or do we now allow skipping one major version?) can remove the server-side handling of InitPut and remove the proto message entirely, once we no longer need to ensure mixed-version compatibility with v22.2. This is primarily a clean-up that reduces the KV API surface area. However, it's also a useful simplification for cockroachdb#72614. Release justification: None. Release note: None.
First half of cockroachdb#71074. This commit replaces all client-side use of InitPut request with the equivalent use of CPut. It uses the following equivalence to perform this mapping: ``` InitPut(key, value) -> CPutAllowingIfNotExists(key, value, value) ``` A future change in v23.2 (or do we now allow skipping one major version?) can remove the server-side handling of InitPut and remove the proto message entirely, once we no longer need to ensure mixed-version compatibility with v22.2. This is primarily a clean-up that reduces the KV API surface area. However, it's also a useful simplification for cockroachdb#72614. Release justification: None. Release note: None.
This comment was marked as outdated.
This comment was marked as outdated.
We've recently made substantial improvements to key-level locking infrastructure that should assist this project. We now support replicated key-level locks (#100193) and support pipelined replicated lock acquisition (#117978). These new capabilities can allow a mutation statement ( |
This issue explores the potential benefits (and costs) of introducing a new mode of operations for transactions, whereby writes would be buffered on the (KV) client until commit time. Currently, of course, writes are eagerly sent to their respective leaseholders and begin (async) replication.
Motivation
I think 1) and 4) are big.
Drawbacks
Jira issue: CRDB-11233
The text was updated successfully, but these errors were encountered: