Bug 768031 - Pin template failure on upgraded dbs.
Pin template failure on upgraded dbs.
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: drift (Show other bugs)
4.3
All All
high Severity urgent (vote)
: ---
: RHQ 4.3.0
Assigned To: Jay Shaughnessy
Mike Foley
:
Depends On: 751778
Blocks: 707225 jon30-sprint10/rhq43-sprint10 786294
  Show dependency treegraph
 
Reported: 2011-12-15 10:09 EST by Jay Shaughnessy
Modified: 2013-09-01 06:14 EDT (History)
0 users

See Also:
Fixed In Version: 4.3
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 786294 (view as bug list)
Environment:
Last Closed: 2013-09-01 06:14:30 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jay Shaughnessy 2011-12-15 10:09:41 EST
Upgrades from RHQ 4.1 to RHQ 4.3-SNAPSHOT are hitting the following
exception when tryng to pin a template:

-ERROR: null value in column "drift_definition_id" violates not-null constraint
Comment 2 Jay Shaughnessy 2011-12-15 10:22:18 EST
The issue here is that the db upgrade is leaving an unwanted NOT NULL
constraint in the db.

The problem can be resolved by applying the following SQL manually:


Postgres:

  Alter Table RHQ_DRIFT_CHANGE_SET Alter Column DRIFT_DEFINITION_ID Drop Not Null

Oracle:

  Alter Table RHQ_DRIFT_CHANGE_SET Modify DRIFT_DEFINITION_ID null
Comment 3 Jay Shaughnessy 2011-12-15 13:53:05 EST
master commit 638de1b71e5eb15b137ca2deda01299a30f5482c

Set RHQ_DRIFT_CHANGE_SET.DRIFT_DEFINITION_ID nullable in the db upgrade.


Also, this is a supporting commit:

commit 4da6f3724d6492ae449ea76100aac8d9948f6303

- Fix a long standing issue in dbupgrade due to Oracle throwing exceptions
  when trying to set nullable to the current value. In other words, the
  upgrade would fail on oracle if you tried to set nullable false on a
  column that was already nullable false. (same for nullable true). This
  caused issues when you can't guarantee the current state, you just know
  what you need it to be.  Now, catch the relevant exceptions and toss
  them as needed.


Test Notes
This problem only happens when upgrading from RHQ 4.1 to 4.3.
Comment 5 Mike Foley 2011-12-16 10:03:32 EST
blocked by 751778
Comment 6 Charles Crouch 2012-01-31 18:40:21 EST
Commits in this BZ were made into master so setting target version to RHQ4.3
Comment 7 Heiko W. Rupp 2013-09-01 06:14:30 EDT
Bulk closing of items that are on_qa and in old RHQ releases, which are out for a long time and where the issue has not been re-opened since.

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