Bug 865166
Summary: | Resource with AvailabilityType of NULL is being returned to UI resulting in ResourceDatasource.copyValues throwing org_rhq_core_domain_resource_Resource_currentAvailability is null | |||
---|---|---|---|---|
Product: | [JBoss] JBoss Operations Network | Reporter: | Larry O'Leary <loleary> | |
Component: | Inventory, UI | Assignee: | Jay Shaughnessy <jshaughn> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Mike Foley <mfoley> | |
Severity: | urgent | Docs Contact: | ||
Priority: | high | |||
Version: | JON 3.1.1 | CC: | fbrychta, mazz, myarboro | |
Target Milestone: | --- | |||
Target Release: | JON 3.1.2 | |||
Hardware: | All | |||
OS: | All | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 865167 (view as bug list) | Environment: | ||
Last Closed: | 2013-09-11 11:01:34 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: | ||||
Bug Depends On: | 865167 | |||
Bug Blocks: | 877176 |
Description
Larry O'Leary
2012-10-10 22:20:05 UTC
A code fix has been committed to upstream that would prevent this from happening in the first place but does not fix the problem if it has already occurred. Therefore, a workaround of executing SQL against the ON database is needed to fix up the database state in the event the system has been impacted by this issue. The provided SQL has not been tested but should fix the issue. master commit c2b37fd00701018fd5df3f99879c6cf4c2fddc4c Jay Shaughnessy <jshaughn> Tue Oct 16 14:04:41 2012 -0400 ** NOTE!!! Once the issue occurs, the code fix will will not automatically solve ** the problem. This workaround code below should be applied. The fix will ** only help future upgrades, not upgrades that have already taken place. Workaround SQL that can be applied to databases suffering from this issue: postgres: INSERT INTO RHQ_RESOURCE_AVAIL ( ID, RESOURCE_ID, AVAILABILITY_TYPE ) SELECT nextval('RHQ_RESOURCE_AVAIL_ID_SEQ'::text), res.ID, 2 FROM RHQ_RESOURCE res LEFT JOIN RHQ_RESOURCE_AVAIL avail ON res.ID = avail.RESOURCE_ID WHERE avail.ID IS NULL oracle: INSERT INTO RHQ_RESOURCE_AVAIL ( ID, RESOURCE_ID, AVAILABILITY_TYPE ) SELECT RHQ_RESOURCE_AVAIL_ID_SEQ.nextval, res.ID, 2 FROM RHQ_RESOURCE res LEFT JOIN RHQ_RESOURCE_AVAIL avail ON res.ID = avail.RESOURCE_ID WHERE avail.ID IS NULL This BZ is to backport the fix from master which will prevent this issue going forward and db upgrade updated with the sql below GSS has confirmed that the queries do resolve this issue once it happens. So, it is recommended that we get this added to the schema update script to ensure that users who are impacted by this will fix it. cherry picked master commit (c2b37fd00701018fd5df3f99879c6cf4c2fddc4c): 3b1a784430f4265e3ab49fc9ea05eb30c4f0f9b1 this does NOT include a db-upgrade.xml change. That has not been developed or checked into master even. the db-upgrade code has been committed to master (4b888be16b1ae2ceb876e85cc82001bbdc79e516) this has been cherry picked to release/jon3.1.x (note: the db schema version was changed from the master version of 2.126 to version 2.122.2 in the release branch): 5c168e69247d5e58adc7fb963b3f2f74803dc423 Moving to ON_QA as available for test with build : https://brewweb.devel.redhat.com//buildinfo?buildID=244662. Verified that upgrade to 3.1.2.ER2 fixes inconsistent state of rhq_resource_avail table (missing rows, NULL availability_type) and import of resources works for both CLI and GUI. (as part of bug 877176) Also verified that inconsistent rhq_resource_avail table is fixed when a resource is imported. Issue still occures when a resource is already imported and the rhq_resource_avail table is edited manualy. Verified that provided queries do resolve this issue. |