Bug 825318 - search bar code for availability querying looks broken
search bar code for availability querying looks broken
Product: RHQ Project
Classification: Other
Component: SearchBar (Show other bugs)
Unspecified Unspecified
unspecified Severity medium (vote)
: ---
: JON 3.1.0
Assigned To: John Mazzitelli
Mike Foley
Depends On: 820716
Blocks: jon310-sprint11/rhq44-sprint11
  Show dependency treegraph
Reported: 2012-05-25 12:23 EDT by John Mazzitelli
Modified: 2013-09-03 11:13 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 820716
Last Closed: 2013-09-03 11:13:42 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Mazzitelli 2012-05-25 12:23:23 EDT
+++ This bug was initially created as a clone of Bug #820716 +++

see this:


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 12:24:46 EDT
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 12:44:51 EDT
two cherry picks to release/3.1.x branch:


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 14:24:55 EDT
fix a problem with conflicts during the cherry pick: release/jon3.1.x commit: b3866debd52593cce9f9bf10bd17df8e3b3da0bc
Comment 4 Sunil Kondkar 2012-05-30 07:04:52 EDT
Verified on Version: 3.1.0.CR1 Build Number: 4bc4270:1b85993

Verified below availabilty search criterias using operators ( = , == , != , !== ) on resources and groups  :

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 11:13:42 EDT
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.