Bug 881848
Summary: | Resource availability type remains in state unknown after application of workaround from bug 865166 | |||
---|---|---|---|---|
Product: | [Other] RHQ Project | Reporter: | Filip Brychta <fbrychta> | |
Component: | Agent, Core Server | Assignee: | Jay Shaughnessy <jshaughn> | |
Status: | ON_QA --- | QA Contact: | ||
Severity: | high | Docs Contact: | ||
Priority: | high | |||
Version: | 4.5 | CC: | hrupp, loleary, mazz | |
Target Milestone: | --- | |||
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 916373 (view as bug list) | Environment: | ||
Last Closed: | 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: | ||||
Bug Blocks: | 916373 |
Description
Filip Brychta
2012-11-29 16:54:50 UTC
this query (followed by executing "Execute Availaiblity Scan" changes-only=false operation) will fix it too: INSERT INTO RHQ_AVAILABILITY ( ID, RESOURCE_ID, START_TIME, END_TIME, AVAILABILITY_TYPE ) SELECT RHQ_AVAILABILITY_ID_SEQ.nextval, res.ID, 0, NULL, 2 FROM RHQ_RESOURCE res WHERE NOT EXISTS ( SELECT * FROM RHQ_AVAILABILITY WHERE RESOURCE_ID = res.ID ) the preivous query was for Oracle, this is for postgres: INSERT INTO RHQ_AVAILABILITY ( ID, RESOURCE_ID, START_TIME, END_TIME, AVAILABILITY_TYPE ) SELECT nextval('RHQ_AVAILABILITY_ID_SEQ'::text), res.ID, 0, NULL, 2 FROM RHQ_RESOURCE res WHERE NOT EXISTS ( SELECT * FROM RHQ_AVAILABILITY WHERE RESOURCE_ID = res.ID ) we need to add a new dbupgrade step for this assigning to jay Post-upgrade the query above must be executed to repair the situation. Otherwise the db-upgrade will take care of it (for versions including the forthcoming commit). The full avail report is required (or an agent restart) to move the avail from UNKNOWN to the actual avail state. master commit 068f664483a2013fa84123cb6b6ba85b54ee7c5c Jay Shaughnessy <jshaughn> Mon Feb 25 16:36:41 2013 -0500 Ensure after upgrade that all resources, including those in the ADQ, have at least an initial UNKNOWN Availability. Test Notes: See above comments. for the record: I tried this upgrade from JON 3.0.0 -> 3.1.2 and, rather than do the SQL query manual to correct the Db, I simply tried to restart the agent with the hope it would send up a full avail report and self-correct the DB. However, this did not happen. The RHQ_AVAILABILITY table is still missing the rows even after the agent restart. The server also spit out these messages when it got the restarted agent's avail report: 09:38:20,048 INFO [AvailabilityManagerBean] Skipping mergeAvailabilityReport() for stale resource [Resource[id=10001, uuid=null, type=<null>, key=null, name=null, parent=<null>]]. These messages should go away after the next agent synchronization with the server. In short, to fix this problem, you have to execute that SQL statement manually after you upgrade to 3.1.2. You only need to do this IF you committed resources AFTER the 3.1.2 upgrade where those resources were in the discovery queue pre-upgrade (that is, when 3.0.0 was running.) |