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

kvserver: QueryResolvedTimestamp should look for intents in LockTable #70796

Conversation

shralex
Copy link
Contributor

@shralex shralex commented Sep 27, 2021

Previously, a request called “QueryResolvedTimestamp” that is used to determine the “resolved timestamp” of a key range on a given replica cost O(num_keys_in_span), because it needed to find all intents in the span and intents were interleaved with key-value versions. A multi-release project to separate out intents from MVCC data is now far enough along that we can make this request more efficient by scanning only the lock-table keyspace, reducing its cost to O(num_locks_in_span).

Release note: None

Release justification: This is going into 22.1 where the migration to separated intents is complete

Fixes: #69717

Previously, a request called “QueryResolvedTimestamp” that is used to determine the “resolved timestamp” of a key range on a given replica costs O(num_keys_in_span), because it needs to find all intents in the span and intents were interleaved with key-value versions. A multi-release project to separate out intents from MVCC data is now far enough along that we can make this request more efficient by scanning only the lock-table keyspace, reducing its cost to O(num_locks_in_span).

Release note: None
@shralex shralex requested a review from a team as a code owner September 27, 2021 21:40
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@shralex shralex requested a review from a team as a code owner September 28, 2021 05:00
@shralex shralex force-pushed the shralex_efficient_QueryResolvedTimestamp branch from e1d9c9a to 7534e4e Compare September 28, 2021 15:02
@shralex shralex force-pushed the shralex_efficient_QueryResolvedTimestamp branch from 7534e4e to cda6e0b Compare September 28, 2021 18:31
@shralex
Copy link
Contributor Author

shralex commented Sep 28, 2021

test this please

@shralex
Copy link
Contributor Author

shralex commented Sep 29, 2021

Closing this, and reopening as #70852

@shralex shralex closed this Sep 29, 2021
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.

kv: only scan separated intents span for QueryResolvedTimestamp requests
2 participants