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: fix the deadlock in rename #2067

Merged
merged 2 commits into from
May 20, 2022
Merged

meta/sql: fix the deadlock in rename #2067

merged 2 commits into from
May 20, 2022

Conversation

davies
Copy link
Contributor

@davies davies commented May 20, 2022

we use lock in SQL database to avoid conflict, the order of locks should be the same, otherwise there will be deadlock.

There is order: parent -> edge -> node -> chunk/flock/plock/edge

For rename, there is two parents, so we lock them in the beginning.

close #2060

@davies davies requested a review from SandyXSD May 20, 2022 06:37
@codecov-commenter
Copy link

Codecov Report

Merging #2067 (b3d1a92) into main (436859d) will increase coverage by 0.15%.
The diff coverage is 57.57%.

@@            Coverage Diff             @@
##             main    #2067      +/-   ##
==========================================
+ Coverage   61.50%   61.66%   +0.15%     
==========================================
  Files         137      138       +1     
  Lines       23893    24529     +636     
==========================================
+ Hits        14695    15125     +430     
- Misses       7478     7630     +152     
- Partials     1720     1774      +54     
Impacted Files Coverage Δ
pkg/meta/sql.go 65.33% <57.57%> (+0.34%) ⬆️
pkg/utils/progress.go 76.47% <0.00%> (-15.30%) ⬇️
pkg/fs/fs.go 75.82% <0.00%> (-1.84%) ⬇️
cmd/bench.go 79.87% <0.00%> (-0.20%) ⬇️
pkg/chunk/cached_store.go 76.19% <0.00%> (-0.19%) ⬇️
pkg/meta/redis.go 71.50% <0.00%> (-0.11%) ⬇️
cmd/stats.go 20.07% <0.00%> (ø)
cmd/objbench.go 58.66% <0.00%> (ø)
pkg/meta/base.go 70.18% <0.00%> (+0.18%) ⬆️
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 436859d...b3d1a92. Read the comment docs.

@davies davies merged commit b05b3df into main May 20, 2022
@davies davies deleted the fix_deadlock branch May 20, 2022 09:40
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.

Deadlock error when isolation level is serializable.
3 participants