Skip to content

concurrency: rollback ignored sequence numbers on lock acquisition#103493

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
arulajmani:savepoint-rollback
May 19, 2023
Merged

concurrency: rollback ignored sequence numbers on lock acquisition#103493
craig[bot] merged 1 commit intocockroachdb:masterfrom
arulajmani:savepoint-rollback

Conversation

@arulajmani
Copy link
Copy Markdown
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 nvb 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
Copy Markdown
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
Copy Markdown
Contributor

@nvb nvb 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
Copy Markdown
Collaborator Author

TFTR!

bors r=nvanbenschoten

@craig
Copy link
Copy Markdown
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