Change in vdsm[ovirt-3.3]: domainMonitor: Separate change detection from lastCheck value

2013-12-11 Thread ybronhei
Yaniv Bronhaim has posted comments on this change.

Change subject: domainMonitor: Separate change detection from lastCheck value
..


Patch Set 2: Verified+1 Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8e0df2ee054146b5d9429fd83a4f914ff751
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer nsof...@redhat.com
Gerrit-Reviewer: Allon Mureinik amure...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Liron Ar lara...@redhat.com
Gerrit-Reviewer: Nir Soffer nsof...@redhat.com
Gerrit-Reviewer: Yaniv Bronhaim ybron...@redhat.com
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[ovirt-3.3]: domainMonitor: Separate change detection from lastCheck value

2013-12-11 Thread ybronhei
Yaniv Bronhaim has submitted this change and it was merged.

Change subject: domainMonitor: Separate change detection from lastCheck value
..


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: I8e0df2ee054146b5d9429fd83a4f914ff751
Relates-To: https://bugzilla.redhat.com/1003588
Signed-off-by: Nir Soffer nsof...@redhat.com
Reviewed-on: http://gerrit.ovirt.org/21878
Reviewed-by: Allon Mureinik amure...@redhat.com
Reviewed-by: Liron Ar lara...@redhat.com
Reviewed-by: Ayal Baron aba...@redhat.com
Reviewed-by: Federico Simoncelli fsimo...@redhat.com
Reviewed-on: http://gerrit.ovirt.org/22209
Reviewed-by: Yaniv Bronhaim ybron...@redhat.com
Tested-by: Yaniv Bronhaim ybron...@redhat.com
---
M vdsm/storage/domainMonitor.py
1 file changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Yaniv Bronhaim: Verified; Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8e0df2ee054146b5d9429fd83a4f914ff751
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer nsof...@redhat.com
Gerrit-Reviewer: Allon Mureinik amure...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Liron Ar lara...@redhat.com
Gerrit-Reviewer: Nir Soffer nsof...@redhat.com
Gerrit-Reviewer: Yaniv Bronhaim ybron...@redhat.com
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[ovirt-3.3]: domainMonitor: Separate change detection from lastCheck value

2013-12-10 Thread nsoffer
Nir Soffer has posted comments on this change.

Change subject: domainMonitor: Separate change detection from lastCheck value
..


Patch Set 1: Verified+1

Verified that monitor is emitting events in the first time domain monitor 
access the storage and then when storage become inaccessible or accessible.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8e0df2ee054146b5d9429fd83a4f914ff751
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer nsof...@redhat.com
Gerrit-Reviewer: Allon Mureinik amure...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Liron Ar lara...@redhat.com
Gerrit-Reviewer: Nir Soffer nsof...@redhat.com
Gerrit-Reviewer: Yaniv Bronhaim ybron...@redhat.com
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[ovirt-3.3]: domainMonitor: Separate change detection from lastCheck value

2013-12-10 Thread nsoffer
Nir Soffer has posted comments on this change.

Change subject: domainMonitor: Separate change detection from lastCheck value
..


Patch Set 1:

And of course that lastCheck value is restored properly to the old behavior.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8e0df2ee054146b5d9429fd83a4f914ff751
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer nsof...@redhat.com
Gerrit-Reviewer: Allon Mureinik amure...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Liron Ar lara...@redhat.com
Gerrit-Reviewer: Nir Soffer nsof...@redhat.com
Gerrit-Reviewer: Yaniv Bronhaim ybron...@redhat.com
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[ovirt-3.3]: domainMonitor: Separate change detection from lastCheck value

2013-12-09 Thread nsoffer
Hello Ayal Baron, Federico Simoncelli, Allon Mureinik, Liron Ar,

I'd like you to do a code review.  Please visit

http://gerrit.ovirt.org/22209

to review the following change.

Change subject: domainMonitor: Separate change detection from lastCheck value
..

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: I8e0df2ee054146b5d9429fd83a4f914ff751
Relates-To: https://bugzilla.redhat.com/1003588
Signed-off-by: Nir Soffer nsof...@redhat.com
Reviewed-on: http://gerrit.ovirt.org/21878
Reviewed-by: Allon Mureinik amure...@redhat.com
Reviewed-by: Liron Ar lara...@redhat.com
Reviewed-by: Ayal Baron aba...@redhat.com
Reviewed-by: Federico Simoncelli fsimo...@redhat.com
---
M vdsm/storage/domainMonitor.py
1 file changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/09/22209/1

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 @@
 from vdsm.config import config
 from sdc import sdCache
 
-NOT_CHECKED_YET = -1
-
 
 class DomainMonitorStatus(object):
 __slots__ = (
@@ -43,7 +41,7 @@
 
 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 @@
 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 @@
 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 @@
 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


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8e0df2ee054146b5d9429fd83a4f914ff751
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer nsof...@redhat.com
Gerrit-Reviewer: Allon Mureinik amure...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Liron Ar lara...@redhat.com
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches


Change in vdsm[ovirt-3.3]: domainMonitor: Separate change detection from lastCheck value

2013-12-09 Thread ybronhei
Yaniv Bronhaim has posted comments on this change.

Change subject: domainMonitor: Separate change detection from lastCheck value
..


Patch Set 1: Code-Review+2

verified?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8e0df2ee054146b5d9429fd83a4f914ff751
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.3
Gerrit-Owner: Nir Soffer nsof...@redhat.com
Gerrit-Reviewer: Allon Mureinik amure...@redhat.com
Gerrit-Reviewer: Ayal Baron aba...@redhat.com
Gerrit-Reviewer: Federico Simoncelli fsimo...@redhat.com
Gerrit-Reviewer: Liron Ar lara...@redhat.com
Gerrit-Reviewer: Yaniv Bronhaim ybron...@redhat.com
Gerrit-HasComments: No
___
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches