Search
j0ke.net Open Build Service
>
Projects
>
virtualization
:
Cloud
:
oVirt
:
3.3.2
>
vdsm
> 0011-domainMonitor-Separate-change-detection-from-lastChe.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0011-domainMonitor-Separate-change-detection-from-lastChe.patch of Package vdsm
From b33afbee6eec61253f40df655b3c5903dafac617 Mon Sep 17 00:00:00 2001 From: Nir Soffer <nsoffer@redhat.com> Date: Sat, 30 Nov 2013 14:49:08 +0200 Subject: [PATCH 11/11] domainMonitor: Separate change detection from lastCheck value Since commit 45f3037ca1e, lastCheck value is initialized to special NOT_CHECKED_YET value, and used for detecting the first monitor status change. This change caused repoStats to return high lastCheck value until the first monitor check is done, causing host activation to fail, and host becoming non-operational. Previously, lastCheck value was initialized to monitor thread creation time, and repoStats was returning valid lastCheck value even before the first domain check was finished. While somewhat incorrect, this behavior is required for engine monitoring logic. This patch restore the previous lastCheck semantics and use a new firstChange flag for detecting the first status change. Change-Id: I8e0df2ee0333354146b5d9429fd83a4f914ff751 Relates-To: https://bugzilla.redhat.com/1003588 Signed-off-by: Nir Soffer <nsoffer@redhat.com> Reviewed-on: http://gerrit.ovirt.org/21878 Reviewed-by: Allon Mureinik <amureini@redhat.com> Reviewed-by: Liron Ar <laravot@redhat.com> Reviewed-by: Ayal Baron <abaron@redhat.com> Reviewed-by: Federico Simoncelli <fsimonce@redhat.com> Reviewed-on: http://gerrit.ovirt.org/22209 Reviewed-by: Yaniv Bronhaim <ybronhei@redhat.com> Tested-by: Yaniv Bronhaim <ybronhei@redhat.com> --- vdsm/storage/domainMonitor.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vdsm/storage/domainMonitor.py b/vdsm/storage/domainMonitor.py index ac01e8b..d95f133 100644 --- a/vdsm/storage/domainMonitor.py +++ b/vdsm/storage/domainMonitor.py @@ -27,8 +27,6 @@ import misc from vdsm.config import config from sdc import sdCache -NOT_CHECKED_YET = -1 - class DomainMonitorStatus(object): __slots__ = ( @@ -43,7 +41,7 @@ class DomainMonitorStatus(object): def clear(self): self.error = None - self.lastCheck = NOT_CHECKED_YET + self.lastCheck = time() self.valid = True self.readDelay = 0 self.diskUtilization = (None, None) @@ -133,6 +131,7 @@ class DomainMonitorThread(object): self.sdUUID = sdUUID self.hostId = hostId self.interval = interval + self.firstChange = True self.status = DomainMonitorStatus() self.nextStatus = DomainMonitorStatus() self.isIsoDomain = None @@ -244,6 +243,8 @@ class DomainMonitorThread(object): self.log.warn("Could not emit domain state change event", exc_info=True) + self.firstChange = False + # An ISO domain can be shared by multiple pools if (not self.isIsoDomain and self.nextStatus.valid and self.nextStatus.hasHostId is False): @@ -257,5 +258,4 @@ class DomainMonitorThread(object): self.status.update(self.nextStatus) def _statusDidChange(self): - return (self.status.lastCheck == NOT_CHECKED_YET or - self.status.valid != self.nextStatus.valid) + return self.firstChange or self.status.valid != self.nextStatus.valid -- 1.8.4.2