Bug 994766 - ResourceTypeCriteria.fetchMetricDefinitions(true) causes duplicates in result set
ResourceTypeCriteria.fetchMetricDefinitions(true) causes duplicates in result...
Status: CLOSED CURRENTRELEASE
Product: JBoss Operations Network
Classification: JBoss
Component: CLI (Show other bugs)
JON 3.2
Unspecified Unspecified
unspecified Severity low
: ER01
: JON 3.3.0
Assigned To: Jay Shaughnessy
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-07 21:23 EDT by Viet Nguyen
Modified: 2014-12-11 09:04 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-12-11 09:04:18 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
test (699 bytes, text/javascript)
2013-08-07 21:23 EDT, Viet Nguyen
no flags Details

  None (edit)
Description Viet Nguyen 2013-08-07 21:23:18 EDT
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 04:27:12 EDT
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 18:00:26 EDT
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 15:32:22 EDT
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@10.16.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@10.16.23.177:4053$ [root@foleymonsterbox1 bin]#
Comment 5 Jay Shaughnessy 2014-08-26 20:00:19 EDT
something is fishy, I'll look into it again...
Comment 6 Jay Shaughnessy 2014-08-29 14:48:48 EDT
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 10:40:58 EDT
.

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