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

concurrency: rollback ignored sequence numbers on lock acquisition #103493

Merged
merged 1 commit into from
May 19, 2023

Conversation

arulajmani
Copy link
Collaborator

@arulajmani arulajmani commented May 17, 2023

This patch adds logic to prune the list of sequence numbers tracked by
the lock table for unreplicated locks. This is done when some of the
tracked sequence numbers are considered ignored, by virtue of a
savepoint rollback.

Note that we only do so for unreplicated locks, and only if an
unreplicated lock is being reacquired. This is because the in-memory
lock table is only the source of truth for in-memory locks; the mvcc
keyspace is the source of truth for replicated ones. As such, trying
to mimic the logic is hard/error-prone -- so we don't attempt to do
so.

Fixes #102269

Release note: None

@arulajmani arulajmani requested a review from nvanbenschoten May 17, 2023 04:11
@arulajmani arulajmani requested a review from a team as a code owner May 17, 2023 04:11
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@arulajmani arulajmani force-pushed the savepoint-rollback branch from 7a16a81 to a778ca0 Compare May 17, 2023 04:15
Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

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

:lgtm: once the first commit is merged.

Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

This patch adds logic to prune the list of sequence numbers tracked by
the lock table for unreplicated locks. This is done when some of the
tracked sequence numbers are considered ignored, by virtue of a
savepoint rollback.

Note that we only do so for unreplicated locks, and only if an
unreplicated lock is being reacquired. This is because the in-memory
lock table is only the source of truth for in-memory locks; the mvcc
keyspace is the source of truth for replicated ones. As such, trying
to mimic the logic is hard/error-prone -- so we don't attempt to do
so.

Fixes cockroachdb#102269

Release note: None
@arulajmani arulajmani force-pushed the savepoint-rollback branch from a778ca0 to 9e78b0a Compare May 19, 2023 17:21
@arulajmani
Copy link
Collaborator Author

TFTR!

bors r=nvanbenschoten

@craig
Copy link
Contributor

craig bot commented May 19, 2023

Build succeeded:

@craig craig bot merged commit b5283bc into cockroachdb:master May 19, 2023
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.

concurrency: rollback locks sequence numbers on lock reacquisition for unreplicated locks
3 participants