Skip to content
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: ignore unevaluated Get requests after optimistic evaluation #78585

Merged
merged 1 commit into from
Mar 30, 2022

Conversation

nvanbenschoten
Copy link
Member

Related to but distinct from #78584.

This commit adds logic to avoid checking for optimistic evaluation conflicts for Get requests which were not evaluated due to a batch-level byte or key limit. This parallels existing logic that does the same for Scan and ReverseScan requests. This was likely missed in the past because we only recently began using Get requests in more places.

The effect of this change is that limited batches of point reads will conflict less with writes, reducing read/write contention. Batches of this form could be issued by a statement that looks like: SELECT * FROM t WHERE id IN (1, 3, 5) LIMIT 2.

Related to but distinct from cockroachdb#78584.

This commit adds logic to avoid checking for optimistic evaluation
conflicts for Get requests which were not evaluated due to a batch-level
byte or key limit. This parallels existing logic that does the same for
Scan and ReverseScan requests. This was likely missed in the past
because we only recently began using Get requests in more places.

The effect of this change is that limited batches of point reads will
conflict less with writes, reducing read/write contention. Batches of
this form could be issued by a statement that looks like:
`SELECT * FROM t WHERE id IN (1, 3, 5) LIMIT 2`.
@nvanbenschoten nvanbenschoten requested a review from a team as a code owner March 27, 2022 21:28
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@aayushshah15 aayushshah15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@nvanbenschoten
Copy link
Member Author

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 30, 2022

Build succeeded:

@craig craig bot merged commit 2f4f3cd into cockroachdb:master Mar 30, 2022
@nvanbenschoten nvanbenschoten deleted the nvanbenschoten/optEvalGet branch March 31, 2022 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants