Change in vdsm[ovirt-3.6.3]: sp: update domain links on state change

fromani at redhat.com fromani at redhat.com
Mon Feb 1 15:34:58 UTC 2016


Francesco Romani has submitted this change and it was merged.

Change subject: sp: update domain links on state change
......................................................................


sp: update domain links on state change

In some situations (e.g. after a reconstructMaster command) the domain
links may be missing and it's impossible to recreate them on
connectStoragePool or refreshStoragePool since the storage may be
unreachable. The best we can do is recreate them as soon as the domains
are visible again.

This patch is based on a patch that was merged into ovirt-engine-3.4
but was never merged into master: https://gerrit.ovirt.org/#/c/27466/ .
It also deals with a few issues that patch had:

- It adds the "@unsecured" decoration to _domainStateChange, since
  without it we get a SecureError in case that the host that runs it is
  not the SPM.

- In the other patch, onDomainStateChange was registered in the
  constructor of StoragePool.
  This is a waste of resources since these events can be called only
  after the connect method is called (specifically, after __rebuild is
  called from within connect).
  Also, onDomainStateChange is never unregistered, causing a leak of a
  registration for every pool disconnection or unsuccessful connection.
  This patch moves the registration to onDomainStateChange to be right
  before it can actually be called (in connect), and calls unregister if
  an error has occurred in __rebuild.
  A call to unregister was also added to the disconnect method, so that
  we won't be listening to events that cannot be called anymore.

- This patch locks the pool and the domain id's in _domainStateChange:
  On the pool, a shared lock is taken since we query the pool's state.
  On the domain, we take a new <domain_uuid>_repo exclusive lock to
  prevent concurrent calls to_refreshDomainLinks.

Relates-To: https://bugzilla.redhat.com/show_bug.cgi?id=1091030
Bug-Url: https://bugzilla.redhat.com/1271771
Change-Id: If116100d3ae967f6a5490a2d91bf923e953cb4ee
Signed-off-by: Idan Shaby <ishaby at redhat.com>
Signed-off-by: Federico Simoncelli <fsimonce at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/51393
Reviewed-by: Nir Soffer <nsoffer at redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-on: https://gerrit.ovirt.org/52902
Reviewed-by: Francesco Romani <fromani at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/52923
Continuous-Integration: Francesco Romani <fromani at redhat.com>
---
M vdsm/storage/sp.py
1 file changed, 47 insertions(+), 3 deletions(-)

Approvals:
  Nir Soffer: Looks good to me, but someone else must approve
  Francesco Romani: Looks good to me, approved; Passed CI tests
  Idan Shaby: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: If116100d3ae967f6a5490a2d91bf923e953cb4ee
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6.3
Gerrit-Owner: Idan Shaby <ishaby at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Idan Shaby <ishaby at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the vdsm-patches mailing list