[MOD-11011] Fix deadlock while RDB loading and RM_Yield#6763
Conversation
035a12a to
13d340b
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6763 +/- ##
==========================================
- Coverage 87.29% 87.21% -0.09%
==========================================
Files 287 287
Lines 45226 45271 +45
Branches 8073 8238 +165
==========================================
+ Hits 39482 39483 +1
- Misses 5621 5663 +42
- Partials 123 125 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.8
git worktree add -d .worktree/backport-6763-to-2.8 origin/2.8
cd .worktree/backport-6763-to-2.8
git switch --create backport-6763-to-2.8
git cherry-pick -x 4710f44833d649d44a78b1095677ccdb918b00fa |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.6
git worktree add -d .worktree/backport-6763-to-2.6 origin/2.6
cd .worktree/backport-6763-to-2.6
git switch --create backport-6763-to-2.6
git cherry-pick -x 4710f44833d649d44a78b1095677ccdb918b00fa |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 2.10
git worktree add -d .worktree/backport-6763-to-2.10 origin/2.10
cd .worktree/backport-6763-to-2.10
git switch --create backport-6763-to-2.10
git cherry-pick -x 4710f44833d649d44a78b1095677ccdb918b00fa |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 8.0
git worktree add -d .worktree/backport-6763-to-8.0 origin/8.0
cd .worktree/backport-6763-to-8.0
git switch --create backport-6763-to-8.0
git cherry-pick -x 4710f44833d649d44a78b1095677ccdb918b00fa |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin 8.2
git worktree add -d .worktree/backport-6763-to-8.2 origin/8.2
cd .worktree/backport-6763-to-8.2
git switch --create backport-6763-to-8.2
git cherry-pick -x 4710f44833d649d44a78b1095677ccdb918b00fa |
* add test file trying to reproduce lock * test RDB update * try the test changes * only keep test changes * remove some logs * fix: Yield to Redis before acquiring Write Lock * proper Lock initialization on RDB load * proper initialization * remove test file * remove comment from code * add numOps instead of reducing Yield frequency * move lock init * add DEBUG command to improve testing * fix failing tests * remove added tests by mistake (cherry picked from commit 4710f44)
* add test file trying to reproduce lock * test RDB update * try the test changes * only keep test changes * remove some logs * fix: Yield to Redis before acquiring Write Lock * proper Lock initialization on RDB load * proper initialization * remove test file * remove comment from code * add numOps instead of reducing Yield frequency * move lock init * add DEBUG command to improve testing * fix failing tests * remove added tests by mistake (cherry picked from commit 4710f44)
* add test file trying to reproduce lock * test RDB update * try the test changes * only keep test changes * remove some logs * fix: Yield to Redis before acquiring Write Lock * proper Lock initialization on RDB load * proper initialization * remove test file * remove comment from code * add numOps instead of reducing Yield frequency * move lock init * add DEBUG command to improve testing * fix failing tests * remove added tests by mistake (cherry picked from commit 4710f44)
* add test file trying to reproduce lock * test RDB update * try the test changes * only keep test changes * remove some logs * fix: Yield to Redis before acquiring Write Lock * proper Lock initialization on RDB load * proper initialization * remove test file * remove comment from code * add numOps instead of reducing Yield frequency * move lock init * add DEBUG command to improve testing * fix failing tests * remove added tests by mistake (cherry picked from commit 4710f44)
…#6787) [MOD-11011] Fix deadlock while RDB loading and RM_Yield (#6763) * add test file trying to reproduce lock * test RDB update * try the test changes * only keep test changes * remove some logs * fix: Yield to Redis before acquiring Write Lock * proper Lock initialization on RDB load * proper initialization * remove test file * remove comment from code * add numOps instead of reducing Yield frequency * move lock init * add DEBUG command to improve testing * fix failing tests * remove added tests by mistake (cherry picked from commit 4710f44)
…#6784) * [MOD-11011] Fix deadlock while RDB loading and RM_Yield (#6763) * add test file trying to reproduce lock * test RDB update * try the test changes * only keep test changes * remove some logs * fix: Yield to Redis before acquiring Write Lock * proper Lock initialization on RDB load * proper initialization * remove test file * remove comment from code * add numOps instead of reducing Yield frequency * move lock init * add DEBUG command to improve testing * fix failing tests * remove added tests by mistake (cherry picked from commit 4710f44) * fix merging * fix merging issues * fix merging issues * fix compilation * fix compilation * do not print index name * add missing func * fix pytest * fix: name of config set command * fix debug command parsing
#6785) * [MOD-11011] Fix deadlock while RDB loading and RM_Yield (#6763) * add test file trying to reproduce lock * test RDB update * try the test changes * only keep test changes * remove some logs * fix: Yield to Redis before acquiring Write Lock * proper Lock initialization on RDB load * proper initialization * remove test file * remove comment from code * add numOps instead of reducing Yield frequency * move lock init * add DEBUG command to improve testing * fix failing tests * remove added tests by mistake (cherry picked from commit 4710f44) * fix compilation * do not print index name * add missing func * fix pytest * fix: remove not-needed pytest file * remove invalid option
Describe the changes in the pull request
This PR aims to solve the issue identified in MOD-11011.
The issue is that RediSearch Yields control to RedisCore while keeping the Write Lock for an Index Spec Lock. During that time, INFO commands may be processed which may take Read Lock of the same lock. In this case, the Read Lock may fail, but since we are still releasing the lock, we enter in the undefined behavior scene and scenarios where the server is locked while trying to acquire again the Write Lock appear.