Bug 994766

Summary: ResourceTypeCriteria.fetchMetricDefinitions(true) causes duplicates in result set
Product: [JBoss] JBoss Operations Network Reporter: Viet Nguyen <vnguyen>
Component: CLIAssignee: Jay Shaughnessy <jshaughn>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: low Docs Contact:
Priority: unspecified    
Version: JON 3.2CC: hrupp, jshaughn, mfoley
Target Milestone: ER01   
Target Release: JON 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-11 14:04:18 UTC 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:
Attachments:
Description Flags
test none

Description Viet Nguyen 2013-08-08 01:23:18 UTC
Created attachment 784184 [details]
test

Description of problem:

var criteria = ResourceTypeCriteria();
...
criteria.fetchMetricDefinitions(true);  <--- set to true
var resTypes = ResourceTypeManager.findResourceTypesByCriteria(criteria);

resTypes will contain duplicate copies of the same resource type


Version-Release number of selected component (if applicable):

Version: 3.2.0.ALPHA_QA
Build Number: edb3aa6:6964581

How reproducible:
100%

Steps to Reproduce:
See attachment

Comment 1 Heiko W. Rupp 2013-08-26 08:27:12 UTC
I see it as well, but don't think it is really critical

rhqadmin@localhost:7080$ exec -f /Users/hrupp/downloads/metric.defs.js
exec -f /Users/hrupp/downloads/metric.defs.js
10
PageList[ResourceType[id=10214, name=Measurement Subsystem, plugin=RHQAgent, category=Service], ResourceType[id=10214, name=Measurement Subsystem, plugin=RHQAgent, category=Service], ResourceType[id=10214, name=Measurement Subsystem, plugin=RHQAgent, category=Service], ResourceType[id=10214, name=Measurement Subsystem, plugin=RHQAgent, category=Service], ResourceType[id=10214, name=Measurement Subsystem, plugin=RHQAgent, category=Service], ResourceType[id=10214, name=Measurement Subsystem, plugin=RHQAgent, category=Service], ResourceType[id=10214, name=Measurement Subsystem, plugin=RHQAgent, category=Service], ResourceType[id=10214, name=Measurement Subsystem, plugin=RHQAgent, category=Service], ResourceType[id=10214, name=Measurement Subsystem, plugin=RHQAgent, category=Service], ResourceType[id=10214, name=Measurement Subsystem, plugin=RHQAgent, category=Service]]
1
PageList[ResourceType[id=10214, name=Measurement Subsystem, plugin=RHQAgent, category=Service]]

Comment 3 Jay Shaughnessy 2014-08-22 22:00:26 UTC
I can't reproduce on master, I'm guessing this was fixed with Lukas's updates to criteria fetch strategy a while back.  setting to ON_QA for 3.3.

Comment 4 Mike Foley 2014-08-26 19:32:22 UTC
marking failed to verify in JON 3.3 ER1.  

i see 2 identical rows for 1 resource in the result set....which is the original problem definition.  



[root@foleymonsterbox1 bin]# ./rhq-cli.sh -u rhqadmin -p rhqadmin -s 10.16.23.177 -t 4053
RHQ Enterprise Remote CLI 4.12.0.JON330ER01
Remote server version is: 3.3.0.ER01 (23b3476:f3aa7e7)
Login successful
rhqadmin.23.177:4053$ exec -f metric.defs.js
1
PageList[ResourceType[id=10083, name=Measurement Subsystem, plugin=RHQAgent, category=Service]]
1
PageList[ResourceType[id=10083, name=Measurement Subsystem, plugin=RHQAgent, category=Service]]

rhqadmin.23.177:4053$ [root@foleymonsterbox1 bin]#

Comment 5 Jay Shaughnessy 2014-08-27 00:00:19 UTC
something is fishy, I'll look into it again...

Comment 6 Jay Shaughnessy 2014-08-29 18:48:48 UTC
Mike, your result is actually the expected behavior. If you look at the script he executes the function twice, once with the fetchMetricDefinitions=true, and once with it false.

What you see is that it found only 1 type each way, which is expected.  If you look at his original description, he got back 10 rows with fetchMetricDefinitions=true and only 1 with it false, which indicates the problem he described.

I think this should be marked VERIFIED. Setting back to ON_QA/ER01.

Comment 7 Mike Foley 2014-09-29 14:40:58 UTC
.