This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 820716

Summary: search bar code for availability querying looks broken
Product: [Other] RHQ Project Reporter: John Mazzitelli <mazz>
Component: SearchBarAssignee: John Mazzitelli <mazz>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: urgent    
Version: 4.4CC: hrupp, jkandasa
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugzilla.redhat.com/show_bug.cgi?id=820981
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 825318 (view as bug list) Environment:
Last Closed: 2013-09-02 03:23:36 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 782579, 825318    

Description John Mazzitelli 2012-05-10 14:37:20 EDT
see this:

 org.rhq.enterprise.server.search.translation.GroupSearchTranslator.getSearchFragment

specifically this code:

            return new SearchFragment( //
                SearchFragment.Type.PRIMARY_KEY_SUBQUERY, "SELECT rg.id" //
                    + "  FROM ResourceGroup rg " //
                    + " WHERE ( SELECT AVG( iavail.availabilityType ) " //
                    + "           FROM rg.explicitResources ires " //
                    + "           JOIN ires.currentAvailability iavail ) " + numericAvailabilityFragment);


We can't do AVG on avail type anymore - since we have more than 0 (down) and 1 (up). We have 2 (unknown) and 3 (disabled) so averaging won't give us what we are expecting.

I think this is code that lets us use "availability" in the search bar to search for availability=UP and availabiltiy=DOWN (and whatever else we allow.. MIXED??? DISABLED??? UNKNOWN???)

We need to double check the search bar ability to query on avaialbilty and get it to work for groups.
Comment 1 John Mazzitelli 2012-05-10 14:39:13 EDT
we also have to make sure we filter out uncommitted resources (which is how I originally found this - I was looking at queries accessing the explicitResources and implicitResources and seeing if they need to add a where clause for res.inventoryStatus = 'COMMITTED'
Comment 2 Charles Crouch 2012-05-11 15:18:19 EDT
We should investigate if this is an issue
Comment 3 John Mazzitelli 2012-05-15 12:05:24 EDT
git commit to master: 6641616

when viewing group lists, in the search bar, you can now specify "availability=down" for example and the only groups you will see are those groups where all members are down. Same with "up" and "disabled"

This also supports != as before.
Comment 4 John Mazzitelli 2012-05-24 17:33:12 EDT
will try to write a unit test for this. if all goes well in master, will clone and put in jon 3.1.0
Comment 5 John Mazzitelli 2012-05-25 12:21:57 EDT
git commit to master f4c13d0 - this is some new unit tests for the availability keyword in the search expression
Comment 6 Jeeva Kandasamy 2012-08-29 08:48:50 EDT
Verified on the build:
JBoss Operations Network 
Version: 3.1.1.ER3
Build Number: 37108ca:67c6de8
GWT Version: 2.4.0
SmartGWT Version: 3.0
Comment 7 Heiko W. Rupp 2013-09-02 03:23:36 EDT
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.