Change in vdsm[master]: fencing: Introduce getHostStatus internal API

nsoffer at redhat.com nsoffer at redhat.com
Wed Jun 18 08:03:16 UTC 2014


Nir Soffer has posted comments on this change.

Change subject: fencing: Introduce getHostStatus internal API
......................................................................


Patch Set 1:

(4 comments)

http://gerrit.ovirt.org/#/c/28873/1/vdsm/storage/clusterlock.py
File vdsm/storage/clusterlock.py:

Line 91:     def hasHostId(self, hostId):
Line 92:         return True
Line 93: 
Line 94:     def getHostStatus(self, hostId):
Line 95:         return sanlock.HOST_UNKNOWN
> Not sure if returning a sanlock constant in a non-snalock implementation is
Agree, should be replaced with our own status code.
Line 96: 
Line 97:     def acquire(self, hostID):
Line 98:         leaseTimeMs = self._leaseTimeSec * 1000
Line 99:         ioOpTimeoutMs = self._ioOpTimeoutSec * 1000


Line 229:                 return False
Line 230: 
Line 231:     def getHostStatus(self, hostId):
Line 232:         try:
Line 233:             # Note: get_hosts has of-by-one bug when asking for particular host
> you probably mean "off-by-one", no?
I had off by one typing error :-)
Line 234:             # id, so get all and filter.
Line 235:             hosts = sanlock.get_hosts(self._sdUUID)
Line 236:         except sanlock.SanlockException as e:
Line 237:             self.log.debug("Error getting host status: %s", e)


Line 374:             currentHostId, lockFile = self._getLease()
Line 375:             return currentHostId == hostId
Line 376: 
Line 377:     def getHostStatus(self, hostId):
Line 378:         return sanlock.HOST_UNKNOWN
> same comment here about non-sanlock impl
agree
Line 379: 
Line 380:     def acquire(self, hostId):
Line 381:         with self._globalLockMapSync:
Line 382:             self.log.info("Acquiring local lock for domain %s (id: %s)",


http://gerrit.ovirt.org/#/c/28873/1/vdsm/storage/hsm.py
File vdsm/storage/hsm.py:

Line 3615:                                       rm.LockType.exclusive):
Line 3616:             self.domainMonitor.stopMonitoring(sdUUID)
Line 3617: 
Line 3618:     @public
Line 3619:     def getHostStatus(self, hostId):
> I really dislike this name. We have too many statuses wondering around the 
Nicer but little too long.
Line 3620:         """
Line 3621:         Returns host status on monitored domains.
Line 3622: 
Line 3623:         Warning: Internal use only.


-- 
To view, visit http://gerrit.ovirt.org/28873
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iccd62e58a194aa0ceb0f5e2503b8ec7e4349971b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Barak Azulay <bazulay at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list