-
Notifications
You must be signed in to change notification settings - Fork 261
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
LSM: fix locking on restart #670
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a1372af
to
4898813
Compare
barpavel
reviewed
Sep 22, 2022
.../modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/lsm/LiveMigrateDiskCommand.java
Show resolved
Hide resolved
.../modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/lsm/LiveMigrateDiskCommand.java
Outdated
Show resolved
Hide resolved
4898813
to
b1909bc
Compare
ahadas
reviewed
Sep 22, 2022
.../modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/lsm/LiveMigrateDiskCommand.java
Outdated
Show resolved
Hide resolved
b1909bc
to
9cce8fa
Compare
ahadas
approved these changes
Sep 22, 2022
barpavel
approved these changes
Sep 22, 2022
.../modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/lsm/LiveMigrateDiskCommand.java
Outdated
Show resolved
Hide resolved
This patch fixes an issue when the engine is restarted during LSM, the command gets stuck. The cause of this issue was that EngineLocks were passed to LiveMigrateDiskCommand, and from there to CreateSnapshotCommand in the executeCommand() stage. There the locks are released, and reacquired later on before snapshot remove phase. If the engine was restarted during CreateSnapshot phase - both the CreateSnapshot and LiveMigrateDisk commands resumed, running reacquireLocks, and then before the Snapshot Remove phase, LiveMigrateDiskCommand attempted to reacquire locks again, getting stuck. In this patch we override reacquireLocks method in LiveMigrateDisk command, doing nothing, and then the locks on Disk and VM are acquired separately before the snapshot remove phase Bug-Url: https://bugzilla.redhat.com/2110186
9cce8fa
to
1982445
Compare
/ost |
unrelated failure in OST |
bennyz
reviewed
Oct 3, 2022
|
||
private EngineLock createEngineLockForSnapshotRemove() { | ||
return new EngineLock( | ||
getExclusiveLocksForSnapshotRemove(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is right, we don't need the disk lock, what we actually need is an exclusive lock on the VM and a shared lock is taken.
(To be clear, this was an existing problem introduced in mkemel@b5d5499)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch fixes an issue when the engine is restarted during LSM, the command gets stuck.
The cause of this issue was that EngineLocks were passed to LiveMigrateDiskCommand, and from there to CreateSnapshotCommand in the executeCommand() stage. There the locks are released, and reacquired later on before snapshot remove phase. If the engine was restarted during CreateSnapshot phase - both the CreateSnapshot and LiveMigrateDisk commands resumed, running reacquireLocks, and then before the Snapshot Remove phase, LiveMigrateDiskCommand attempted to reacquire locks again, getting stuck.
In this patch we override reacquireLocks method in LiveMigrateDisk command, doing nothing, and then the locks on Disk and VM are acquired separately before the snapshot remove phase
Bug-Url: https://bugzilla.redhat.com/2110186