Bug 1166640

Summary: Availability check is executed on resource even while its availability metric is disabled
Product: [JBoss] JBoss Operations Network Reporter: Libor Zoubek <lzoubek>
Component: Plugin ContainerAssignee: Libor Zoubek <lzoubek>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: urgent Docs Contact: Sunil Kondkar <skondkar>
Priority: unspecified    
Version: JON 3.3.0CC: jshaughn, loleary, miburman, skondkar, theute
Target Milestone: ER01   
Target Release: JON 3.3.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-27 19:58:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 869451    
Attachments:
Description Flags
disabled availability none

Description Libor Zoubek 2014-11-21 11:41:13 UTC
Created attachment 959662 [details]
disabled availability

Description of problem:

If I disable collecting availability metric on resource, the metric is still collected.


Version-Release number of selected component (if applicable):
JON 3.3.0.GA 
Build Number : f8f6447:6a2b52e

How reproducible: always


Steps to Reproduce:
1. have a resource which is UP (i.e. AS7 server)
2. disable availability metric on this resource
3. shutdown your AS7 server

Actual results:

After step #2 availability is still collected. Resource seems still to be UP and also in UI when you expand availability stats. After step #3 resource is suddenly reported as DOWN - which is another indicator, that availability is still being collected 


Expected results:

After step #2 resource could indicate availability = UP (inherits from parent), but at least in avail stats, there must be values indicating disabled availability, when managed resource goes down, this must not affect resource availability, availability must NOT be collected on agent.


Additional info:

Comment 1 Jay Shaughnessy 2014-11-21 14:24:18 UTC
This is normal.  Disabling the availability metric just makes it defer to the parent's availability, which means it takes no resources.  This is not a bug, working as expected.

Comment 2 Jay Shaughnessy 2014-11-21 14:56:19 UTC
OK, I apologize, I didn't read this closely enough.  The reason you see what you see is because you navigated to the resource in the UI.  For the UI-focused resource we perform live avail checks every 15s.  This bypasses the scheduled avail checks, which are in fact deferring to the parent.

I could see how this might be confusing because the live avail and the scheduled avail could actually differ.

Having said that, I'm not really sure the current behavior is bad, as at least in the UI, where you are likely quite interested in the resource, you will see the proper avail, and it's not actually scheduled metric collection.

It will be up to others to decide if this is a problem and if the UI call should consider the "disabled" state.

Comment 3 Jay Shaughnessy 2014-11-21 15:17:18 UTC
One more thing, to be clear, the DISABLED availability is reported *only when the resource is disabled*.  Disabling the avail metric only affects the avail reporting by deferring to the parent, the avail will still be UP or DOWN.

Comment 4 Libor Zoubek 2014-11-25 16:25:51 UTC
This buggy behaviour is caused by UI avail checks. When an immediate avail check is done via UI, avail check was performed and left signs of enabled avail schedule in ResourceContainer memory, which switched on collecting disabled availability on agent. Agent restart would of course re-set schedule to "correctly disabled", and also there is a chance of missing UI avail check when disabling schedule, so one could observe correct behaviour.

As disscussed with Jay, correct way (and fix) is NOT to perform avail check in case of immediate avail check request. This means .. if availability metric is disabled, agent always defers to parent (including immediate check).

Comment 5 Libor Zoubek 2014-11-26 00:01:50 UTC
branch:  master
link:    https://github.com/rhq-project/rhq/commit/e43c4d9d3
time:    2014-11-25 21:27:23 +0100
commit:  e43c4d9d38270073cba398c2a3d08f7ad9d6be7d
author:  Libor Zoubek - lzoubek
message: Bug 1166640 - Disabling availability metric has no effect

         Do not forceRootScan when resource's avail schedule is
         currently disabled. Also fix CustomScanRootAvailabilityExecutor
         to clean up availabilityScheduleTime in case it is ever used
         with forceRootScan=true on resource with avail schedule
         disabled

Comment 6 Michael Burman 2015-01-14 07:01:41 UTC
Cherry-picked to release/jon3.3.x:

commit 3e35ef0fef6b07d630fe9b72bae5c40a65c4d9ca
Author: Libor Zoubek <lzoubek>
Date:   Tue Nov 25 17:39:59 2014 +0100

    Bug 1166640 - Disabling availability metric has no effect
    
    Do not forceRootScan when resource's avail schedule is currently disabled.
    Also fix CustomScanRootAvailabilityExecutor to clean up
    availabilityScheduleTime in case it is ever used with forceRootScan=true on
    resource with avail schedule disabled
    
    (cherry picked from commit e43c4d9d38270073cba398c2a3d08f7ad9d6be7d)

Comment 7 Simeon Pinder 2015-01-26 08:15:10 UTC
Moving to ON_QA as available for test with the latest 3.3.1.ER01 bits from here:
http://download.devel.redhat.com/brewroot/packages/org.jboss.on-jboss-on-parent/3.3.0.GA/12/maven/org/jboss/on/jon-server-patch/3.3.0.GA/jon-server-patch-3.3.0.GA.zip

Comment 8 Sunil Kondkar 2015-01-28 14:50:35 UTC
Verified on 3.3.0.GA Update 01. Verified that after steps 3, after disabling the availability metric and when managed resource goes down, the resource shows availability up.
Resource availability remains up after executing avail scan operation on agent.