Bug 820716 - search bar code for availability querying looks broken
Summary: search bar code for availability querying looks broken
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: RHQ Project
Classification: Other
Component: SearchBar
Version: 4.4
Hardware: Unspecified
OS: Unspecified
urgent
medium
Target Milestone: ---
: ---
Assignee: John Mazzitelli
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On:
Blocks: jon310-sprint11, rhq44-sprint11 825318
TreeView+ depends on / blocked
 
Reported: 2012-05-10 18:37 UTC by John Mazzitelli
Modified: 2013-09-02 07:23 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 825318 (view as bug list)
Environment:
Last Closed: 2013-09-02 07:23:36 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 820981 0 unspecified CLOSED fix group queries to not return non-committed resources 2021-02-22 00:41:40 UTC

Internal Links: 820981

Description John Mazzitelli 2012-05-10 18:37:20 UTC
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 18:39:13 UTC
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 19:18:19 UTC
We should investigate if this is an issue

Comment 3 John Mazzitelli 2012-05-15 16:05:24 UTC
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 21:33:12 UTC
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 16:21:57 UTC
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 12:48:50 UTC
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 07:23:36 UTC
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.


Note You need to log in before you can comment on or make changes to this bug.