Bug 825318 - 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
unspecified
medium
Target Milestone: ---
: JON 3.1.0
Assignee: John Mazzitelli
QA Contact: Mike Foley
URL:
Whiteboard:
Depends On: 820716
Blocks: jon310-sprint11, rhq44-sprint11
TreeView+ depends on / blocked
 
Reported: 2012-05-25 16:23 UTC by John Mazzitelli
Modified: 2013-09-03 15:13 UTC (History)
2 users (show)

Fixed In Version:
Clone Of: 820716
Environment:
Last Closed: 2013-09-03 15:13:42 UTC
Embargoed:


Attachments (Terms of Use)

Description John Mazzitelli 2012-05-25 16:23:23 UTC
+++ This bug was initially created as a clone of Bug #820716 +++

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-25 16:24:46 UTC
Need to cherry pick to the release branch the following:

** git commit to master f4c13d0 - this is some new unit tests for the availability keyword in the search expression

** 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 2 John Mazzitelli 2012-05-25 16:44:51 UTC
two cherry picks to release/3.1.x branch:

310e054924f52685904ab841d557c2f1b58aed24
d9f41878fbfff7659e62a82a7f7195142e11693d

the latter caused a conflict so I had to manually fix it. see https://bugzilla.redhat.com/show_bug.cgi?id=820432#c4 from bug 820432

Comment 3 John Mazzitelli 2012-05-25 18:24:55 UTC
fix a problem with conflicts during the cherry pick: release/jon3.1.x commit: b3866debd52593cce9f9bf10bd17df8e3b3da0bc

Comment 4 Sunil Kondkar 2012-05-30 11:04:52 UTC
Verified on Version: 3.1.0.CR1 Build Number: 4bc4270:1b85993

Verified below availabilty search criterias using operators ( = , == , != , !== ) on resources and groups  :
availability=up
availability=down
availability=disabled
availability=unknown 

The search results display correct results ( Ex: for "availability=down" , only groups with all members down appear in search results)

Observed one issue with groups without members having unknown status. This group appears in every availabilty search result. I filed a new bug#826493 to address this.

Marking this bug as verified.

Comment 5 Heiko W. Rupp 2013-09-03 15:13:42 UTC
Bulk closing of old issues in VERIFIED state.


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