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

lvutil: Remove SR lock during thin attach/detach #648

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

benjamreis
Copy link
Contributor

@benjamreis benjamreis commented Oct 17, 2023

This lock is normally useless and can create a dead lock when thin mode is activated:

  • A task tries to deactivate a volume during a VM shutdown on a slave (so a VDI A is locked). Then a new task is created on the master host, we try to get the SR lock on the master.
  • In parallel a tap-pause is asked from the master to the slave, the master SR lock is now locked. The tap-pause request is received on the slave, but we can't lock VDI A because it's already locked.

So to summarize: a dead lock is only possible if we try to shutdown a VM with a particular VDI and if we try to snapshot it in the same time.

This lock is normally useless and can create a dead lock when thin mode is activated:
- A task try to deactivate a volume during a VM shutdown on a slave (so a VDI A is locked).
  Then a new task is created on the master host, we try to get the SR lock on the master.
- In parallel a tap-pause is asked from the master to the slave, the master SR lock is now locked.
  The tap-pause request is received on the slave, but we can't lock VDI A because it's already
  locked.

So to resume: a dead lock is only possible if we try to shutdown a VM with a particular VDI
and if we try to snapshot it in the same time.

Signed-off-by: BenjiReis <benjamin.reis@vates.fr>
@benjamreis
Copy link
Contributor Author

It is an issue we found out on our Linstor driver that also applies to this one.

Unless the lock is necessary to activate the LVM cache, in this case we can re add it only for the cache.

@benjamreis benjamreis changed the title Remove SR lock during thin attach/detach lvutil: Remove SR lock during thin attach/detach Oct 17, 2023
@MarkSymsCtx
Copy link
Contributor

MarkSymsCtx commented Nov 30, 2023

So to summarize: a dead lock is only possible if we try to shutdown a VM with a particular VDI and if we try to snapshot it in the same time.

This sounds like the solution would be for the initiating process on the coordinator to hold a lock on the VDI whilst performing these operations and not permit the detach and snapshot operations to occur in parallel, that sounds like an unending recipe for edge cases.

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.

None yet

2 participants