Skip to content

Conversation

fqazi
Copy link
Collaborator

@fqazi fqazi commented Apr 8, 2025

Previously, a race condition existed between the name cache and the logic used to clean up old versions of leased descriptors. This issue was introduced when atomic operations were used to manipulate the descriptor version states. Specifically, after ensuring the reference count is zero, it's necessary to acquire a lock before releasing the stored lease. This patch adds logic to acquire and release a mutex when cleaning up old versions.

Fixes: #143815

Release note: None

Previously, a race condition existed between the name cache and the
logic used to clean up old versions of leased descriptors. This issue
was introduced when atomic operations were used to manipulate the
descriptor version states. Specifically, after ensuring the reference
count is zero, it's necessary to acquire a lock before releasing the
stored lease. This patch adds logic to acquire and release a mutex when
cleaning up old versions.

Fixes: cockroachdb#143815

Release note: None
@fqazi fqazi requested a review from a team as a code owner April 8, 2025 18:13
Copy link

blathers-crl bot commented Apr 8, 2025

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

@fqazi
Copy link
Collaborator Author

fqazi commented Apr 8, 2025

@rafiss TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Apr 8, 2025

@craig craig bot merged commit 57a9a63 into cockroachdb:master Apr 8, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lease: data race in an upgrade test
3 participants