From Maor Lipchuk <mlipchuk(a)redhat.com>:
Maor Lipchuk has submitted this change and it was merged.
Change subject: core: Register OVF_STORE disk at the end of the transaction.
......................................................................
core: Register OVF_STORE disk at the end of the transaction.
It appears that in some of the postgresql server versions (9.2.18 for
example) a dead lock might occur when attaching a storage domain
that gets upgraded (For example from V3 to V4).
the reason for this dead lock is that AttachStorageDomainToPoolCommand
creates a new transaction and updates the format version
of the storage domain.
As part of this transaction it also calls RegisterDiskCommand
to register the OVF_STORE disks of the storage doman,
RegisterDiskCommand also opens a new transaction and tries
to insert data into image_storage_domain_map table.
Because the new thread in RegisterDiskCommand waits for the lock, which
was aquired as part of the update format, to be freed,
the engine encounters a DB dead lock.
Therefore changing the order of the actions in the trnsaction so the
register of the disks will be before the version update
should avoid this deadlock.
Change-Id: If06cf896c07077e52c71ad33daf1508b3b2c7c86
Bug-Url:
https://bugzilla.redhat.com/1446878
Signed-off-by: Maor Lipchuk <mlipchuk(a)redhat.com>
---
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/domain/AttachStorageDomainToPoolCommand.java
1 file changed, 3 insertions(+), 2 deletions(-)
Approvals:
Jenkins CI: Passed CI tests
Allon Mureinik: Looks good to me, approved
Maor Lipchuk: Verified
Liron Aravot: Looks good to me, but someone else must approve
--
To view, visit
https://gerrit.ovirt.org/76475
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: If06cf896c07077e52c71ad33daf1508b3b2c7c86
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Liron Aravot <laravot(a)redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipchuk(a)redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>