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

meta/sql: use upsert in Write() to avoid possible deadlock #4529

Merged
merged 3 commits into from
Mar 19, 2024
Merged

Conversation

SandyXSD
Copy link
Contributor

@SandyXSD SandyXSD commented Mar 18, 2024

close #4494
The current behavior with possible deadlock is not a bug (see: https://bugs.mysql.com/bug.php?id=96748). However, using upsert seems to be a better way.

Copy link

codecov bot commented Mar 18, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 55.68%. Comparing base (eb5fa9d) to head (caa7c6e).
Report is 6 commits behind head on main.

Files Patch % Lines
pkg/meta/sql.go 92.30% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4529      +/-   ##
==========================================
- Coverage   55.68%   55.68%   -0.01%     
==========================================
  Files         157      157              
  Lines       42605    42618      +13     
==========================================
+ Hits        23726    23731       +5     
- Misses      16243    16256      +13     
+ Partials     2636     2631       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SandyXSD SandyXSD changed the title meta/sql: try insert before adding x lock meta/sql: use upsert in Write() to avoid possible deadlock Mar 19, 2024
@SandyXSD SandyXSD merged commit 90e549b into main Mar 19, 2024
36 checks passed
@SandyXSD SandyXSD deleted the sql-write branch March 19, 2024 01:50
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.

MySQL frequently reports transaction error when use juicefs sync to backup data
2 participants