Federico Simoncelli has posted comments on this change.
Change subject: sp: move reconnection info check to StoragePool
......................................................................
Patch Set 3:
(4 comments)
....................................................
File vdsm/storage/hsm.py
Line 1027: except se.StoragePoolUnknown:
Line 1028: pass # pool not connected yet
Line 1029: else:
Line 1030: with rmanager.acquireResource(STORAGE, spUUID,
rm.LockType.shared):
Line 1031: pool.update(hostID, scsiKey, msdUUID, masterVersion)
Done
Line 1032: return True
Line 1033:
Line 1034: with rmanager.acquireResource(STORAGE, spUUID,
rm.LockType.exclusive):
Line 1035: try:
Line 1036: pool = self.getPool(spUUID)
Line 1037: except se.StoragePoolUnknown:
Line 1038: pass # pool not connected yet
Line 1039: else:
Line 1040: pool.update(hostID, scsiKey, msdUUID, masterVersion)
No, here it's correct, we're under the exclusive lock.
Line 1041: return True
Line 1042:
Line 1043: pool = sp.StoragePool(spUUID, self.domainMonitor,
self.taskMng)
Line 1044: res = pool.connect(hostID, scsiKey, msdUUID,
masterVersion)
....................................................
File vdsm/storage/sp.py
Line 688: msg = "Pools temp data dir: %s does not exist" % (
Line 689: self._poolsTmpDir)
Line 690: raise se.StoragePoolConnectionError(msg)
Line 691:
Line 692: self._saveReconnectInformation(hostID, scsiKey, msdUUID,
masterVersion)
I'm going to refactor out the pool persistency in a patch that I haven't pushed
yet. We'll discuss this there.
Line 693: self.id = hostID
Line 694: self.scsiKey = scsiKey
Line 695: # Make sure SDCache doesn't have stale data (it can be in
case of FC)
Line 696: sdCache.invalidateStorage()
Line 741:
Line 742: @unsecured
Line 743: def getPoolParams(self, hostID, scsiKey, msdUUID, masterVersion):
Line 744: if all(hostID, scsiKey, msdUUID, masterVersion):
Line 745: return hostID, scsiKey, msdUUID, masterVersion
this is as it was in hsm.py:
if not hostID or not scsiKey or not msdUUID or not masterVersion:
hostID, scsiKey, msdUUID, masterVersion = pool.getPoolParams()
Line 746:
Line 747: self.log.info(
Line 748: "Using saved connection parameters: hostID=%s,
scsiKey=%s, "
Line 749: "msdUUID=%s, masterVersion=%s", hostID, scsiKey, msdUUID,
--
To view, visit http://gerrit.ovirt.org/21424
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ia57afc04db02b6c15633d09349a55b3ff5ae7fda
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches