Change in ovirt-engine[ovirt-engine-4.0]: core: DomainPoolMap race - domain in 'detaching' as attached

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Mon Jun 20 07:20:18 UTC 2016


Piotr Kliczewski has submitted this change and it was merged.

Change subject: core: DomainPoolMap race - domain in 'detaching' as attached
......................................................................


core: DomainPoolMap race - domain in 'detaching' as attached

When executing connectStoragePool/reconstructMaster verbs the engine
build the domain map and passes it to vdsm.

When deactivating domain its status is changed to 'Detaching' in the
begining of the operation, domains in that status aren't included in
the built domain map.

If multiple domain deactivations are performed concurrently the following
scenario could occur:
1. domain A deactivation start -> status changed to Deactivating
2. domain B deactivation start -> status changed to Deactivating
3. DeactiveStorageDomainVdsCommand executed for domain A
4. ConnectStoragePool is executed as part as domain A deactivation flow.
Both domains A and B aren't sent as part of the domain pool map as they
are in Deactivating status.
5. DeactiveStorageDomainVdsCommand executed for domain B and fails as
the domain isn't part of the pool domains anymore (as it wasn't sent as
part of the ConnectStoragePool call).
6. As part of the pool metadata synchronization domain B is marked as
detached altough its metadata wasn't updated to reflect that its not a
part of a storage pool.

The current solution to this race condition is to send domains in
Deactivating  status as 'attached', domains in 'attached' status aren't
being accessed by the host anyway and the last deactivation pool metadata
refresh should contain the updated information to all the hosts.
Additionally, if the detach operation fails on the spm - this will
allow to activate the domain again.

Change-Id: I5e45ce1bbd37f3562c988a427026ec07c471d7e2
Bug-Url: https://bugzilla.redhat.com/1324076
Signed-off-by: Liron Aravot <laravot at redhat.com>
---
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/domain/DetachStorageDomainFromPoolCommand.java
M backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/storage/StoragePoolDomainHelper.java
2 files changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Jenkins CI: Passed CI tests
  Allon Mureinik: Looks good to me, approved
  Liron Aravot: Verified



-- 
To view, visit https://gerrit.ovirt.org/59440
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5e45ce1bbd37f3562c988a427026ec07c471d7e2
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-4.0
Gerrit-Owner: Liron Aravot <laravot at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Liron Aravot <laravot at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>



More information about the Engine-commits mailing list