Description of problem: The detection of the duplicate resource keys during resource upgrade is flawed. The detection fails for the case when 2 resources upgrade to the same resource key. Version-Release number of selected component (if applicable): 4.0.0 How reproducible: always Steps to Reproduce: 1. Build the latest code from release-3.0.1 branch to get the latest changes to the apache plugin 2. Discover some apache server with some vhosts 3. for at least 2 vhosts, set the "SNMP WWW Service Index" value in the connection properties to the same number (functionality-wise, this is an invalid state, but we shouldn't mess up the inventory because of that) 4. install latest master 5. upgrade the database, leaving the data in 6. start the upgraded agent 7. look into the database - the vhost resources are going to have the same resource key Actual results: There are 2 resources under a single parent having the same resource key, which is an error Expected results: The upgrade should have failed and the resources stopped so that the user can clean up the inventory. Additional info:
Fixed in release-4.0.0 branch by commit: commit bd8335935aff914bc2a40860afda96daed6ad20e Author: Lukas Krejci <lkrejci> Date: Wed May 18 15:50:47 2011 +0200 Merging resource-upgrade-fixes from master. and in master by commit: commit 6ea278d85a438acc216a33dcd831d53e34e3c85a Merge: 241f8a1 3ff7587 Author: Lukas Krejci <lkrejci> Date: Wed May 18 15:39:23 2011 +0200 Merge branch 'master-resource-upgrade-fixes'
1. Downloaded the rhq301 build from 'https://brewweb.devel.redhat.com//buildinfo?buildID=164904' 2. Discovered apache server with two vhosts and the "SNMP WWW Service Index" value in the connection properties is set to the same number in both vhosts. 3. Stopped the rhq server and installed latest build#36 (https://hudson.qa.jboss.com/hudson/view/Jon-2.x/job/release-4.0.0/36/) 4. The vhosts after upgrade are displayed as unavailable and the upgraded agent log displays below: 2011-05-19 16:17:52,321 ERROR [main] (rhq.core.pc.upgrade.ResourceUpgradeDelegate)- Upgrading the resource [Resource[id=10801, type=Apache Virtual Host, key=monitoring-test:8081, name=127.0.0.1:8081, parent=sunillaptop:80]] using these updates [ResourceUpgradeRequest[resourceId = '10801', newResourceKey = 'monitoring-test:8081|127.0.0.1:8081', newName = 'null', newDescription = 'null', upgradeErrorMessage = 'null', upgradeErrorStackTrace = 'null']] would render the inventory invalid because of the following reasons: Another inventoried sibling resource of the same type already has the proposed resource key or would have it after the upgrade. 2011-05-19 16:17:52,322 ERROR [main] (rhq.core.pc.upgrade.ResourceUpgradeDelegate)- Upgrading the resource [Resource[id=10032, type=Apache Virtual Host, key=monitoring-test:8080, name=127.0.0.1:8080, parent=sunillaptop:80]] using these updates [ResourceUpgradeRequest[resourceId = '10032', newResourceKey = 'monitoring-test:8081|127.0.0.1:8081', newName = 'null', newDescription = 'null', upgradeErrorMessage = 'null', upgradeErrorStackTrace = 'null']] would render the inventory invalid because of the following reasons: Another inventoried sibling resource of the same type already has the proposed resource key or would have it after the upgrade. 5. The postgres database queries display different resource keys for vhost resources (127.0.0.1:8080 and 127.0.0.1:8081) rhq301=# SELECT resource_key, name FROM rhq_resource where id=10032; resource_key | name ----------------------+---------------- monitoring-test:8080 | 127.0.0.1:8080 (1 row) rhq301=# SELECT resource_key, name FROM rhq_resource where id=10801; resource_key | name ----------------------+---------------- monitoring-test:8081 | 127.0.0.1:8081 Marking as verified.
Bulk closing of issues that were VERIFIED, had no target release and where the status changed more than a year ago.