Red Hat Bugzilla – Bug 594516
search: group definitions parameterized filters are too strict
Last modified: 2010-08-12 12:46:15 EDT
Description of problem:
When you search using things like trait[foo], it will search for "foo" exactly. We probably want this to be a substring match by default.
Steps to Reproduce:
1. Inventory some SOA servers with the "production" config set active
2. Create group def with "groupby resource.trait[partitionName]"
3. Calculate the membership
No dynagroup children created
One dynagroup child created, with the single SOA server in it, with it's partitionName (something like "SOADomain" by default)
Root of the problem is that the SOA trait is not simply "partitionName", it is actually "MCBean|ServerConfig|*|partitionName". If we implement substring matching for parameterized values inside '[' amd ']', then it would find EAP and SOA servers. Users could still use other expressions to either filter the results further or create more/smaller subgroups.
(11:03:06 AM) uaarkoti: ccrouch: the problem with 594516 is that if a customer is running EAP 5, they cannot create a group definition to group them dynamically. It might be ok to create a compatible group and add the instances manually but if there are large deployments its a pain.
(11:05:20 AM) ccrouch: uaarkoti: is 594516 a regression from 2.3.1 ?
(11:05:58 AM) uaarkoti: ccrouch: Yes
Ignore that needinfo flag
Just want to clarify my comment earlier. Since the
partitionName is not set, creating a group definition to group based on partition name results in no groups.
Author: Joseph Marques <email@example.com>
Date: Wed Jun 16 00:54:05 2010 -0400
BZ-594516: support implicit substring matching for bracketed properties
On the one hand, this can be viewed as a feature enhancement because the query generator is doing precisely what it was coded to do. On the other hand, it can be viewed as a regression because the user-perceived functionality/interaction has changed.
Recall that the SOA plugin didn't exist when the DynaGroup functionality was originally written. Historically, all JBossAS servers (JBossAS community editions as well as EAP servers) could be grouped by cluster membership with with a single expression:
But the SOA server chose a different name for this internal attribute / trait. Instead of using 'partitionName' it uses 'MCBean|ServerConfig|*|partitionName'. So this fix makes it possible to use the single expression above to group JBossAS, EAP, and SOA servers.
FYI: this was literally a two-line fix. The probably of regression is extremely low due to having a full set of unit tests in place to verify that the ExpressionEvaluator is generating the correct JPQL. This enhancement is specifically verified through the half dozen unit tests that generate JPQL for bracketed expressions.
Keep in mind, we still need to fix https://bugzilla.redhat.com/show_bug.cgi?id=594520 , which is a clear regression over previous releases.
QA Verified. Creating dynagroups via this query results in the dynagroup being appropriately populated.
Mass-closure of verified bugs against JON.