Bug 990466

Summary: Dynagroup definitions - Expressions create empty groups
Product: [Other] RHQ Project Reporter: Filip Brychta <fbrychta>
Component: Core Server, Resource GroupingAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: low Docs Contact:
Priority: unspecified    
Version: 4.8CC: hrupp, jshaughn
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:

Description Filip Brychta 2013-07-31 09:13:05 UTC
Description of problem:
According to https://docs.jboss.org/author/display/RHQ/Group+Definitions - expressions should not create empty groups but they do on 4.9.0-SNAPSHOT
Build Number: 067cb8c

Version-Release number of selected component (if applicable):
Version: 4.9.0-SNAPSHOT
Build Number: 067cb8c

How reproducible:
Always

Steps to Reproduce:
1. create a new dynagroup definition with following expression: 'resource.type.name = nonExistingTypeName'
2. click on Save&Recalculate


Actual results:
Empty dynagroup is created.

Expected results:
Expressions will not create empty groups

Additional info:
The same behaviour for following expressions:
- memberOf = nonExistingGroup
- memberOf = emptyGroup

Comment 1 Jirka Kremser 2013-07-31 11:30:40 UTC
I would fix the documentation rather than the actual implementation. Sometimes it can be useful to have an empty managed group, take for instance dynagroup definition for all resources that are down "resource.availability = DOWN". 

One can have an CLI script checking the size of the resulting group, but if the group doesn't exist it is more difficult for him to do the same. I haven't looked to the code, but I can imagine the id for group is reassigned over and over again if the resulting group is empty => non-existent and subsequently non-empty => has to be created again.

To me it is more confusing to have multiple groups appearing and disappearing in the groups inventory than to have few empty groups that actually indicate some state of the system (there are no such resources that fulfill the condition).