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: deadlock when getting replica.Desc while under lock #66760

Merged
merged 1 commit into from
Jun 23, 2021

Conversation

aliher1911
Copy link
Contributor

@aliher1911 aliher1911 commented Jun 23, 2021

Error logging was using replica.Desc() to get range keys while
already operating under replica read lock. It was causing deadlock
if another go routine tried to acquire a write.
We already have a description locally so no need to get locks at
all.

Release note (bug fix): Fix deadlock during adminVerifyProtectedTimestamp

Fixes #66759

Error logging was using replica.Desc() to get range keys while
already operating under replica read lock. It was causing deadlock
if another go routine tried to acquire a write.
We already have a description locally so no need to get locks at
all.

Release note (bug fix): Fix deadlock during adminVerifyProtectedTimestamp
@aliher1911 aliher1911 requested review from tbg and adityamaru June 23, 2021 12:38
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@adityamaru
Copy link
Contributor

Ran go test -tags deadlock -run TestProtectedTimestampRecordApplies ./pkg/kv/kvserver before and after this change just to double-check, and the test is passing now.

@aliher1911
Copy link
Contributor Author

bors r=tbg,adityamaru

@craig
Copy link
Contributor

craig bot commented Jun 23, 2021

Build succeeded:

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.

kvserver: deadlock in protectedts error message
4 participants