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

catalog/lease: detect if synchronous lease releases are successful #118543

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

fqazi
Copy link
Collaborator

@fqazi fqazi commented Jan 31, 2024

Previously, for unit testing, we added support for synchronously releasing leases. If the context was cancelled when releasing a lease synchronously, it was possible for the lease to be erased from memory and not from storage. As a result, reacquisition could hit an error when session-based leasing is enabled. To address this, this patch re-orders operations so that we clear storage first for synchronous lease release, followed by the in-memory copy.

Fixes: #118522, fixes #118523, fixes #118521, fixes #118550

Release note: None

Previously, for unit testing, we added support for synchronously
releasing leases. If the context was cancelled when releasing a lease
synchronously, it was possible for the lease to be erased from memory
and not from storage. As a result, reacquisition could hit an error when
session-based leasing is enabled. To address this, this patch re-orders
operations so that we clear storage first for synchronous lease release,
followed by the in-memory copy.

Fixes: cockroachdb#118522, cockroachdb#118523, cockroachdb#118521

Release note: None
@fqazi fqazi requested a review from a team as a code owner January 31, 2024 19:13
Copy link

blathers-crl bot commented Jan 31, 2024

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @fqazi)

@fqazi
Copy link
Collaborator Author

fqazi commented Jan 31, 2024

@rafiss TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Jan 31, 2024

Build succeeded:

@craig craig bot merged commit d3c3d4e into cockroachdb:master Jan 31, 2024
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants