Bug 1700759 - engine failed schema refresh v4.3.2 -> v4.3.3
Summary: engine failed schema refresh v4.3.2 -> v4.3.3
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: Database.Core
Version: 4.3.3.3
Hardware: x86_64
OS: Linux
unspecified
urgent
Target Milestone: ovirt-4.3.3-1
: ---
Assignee: Daniel Erez
QA Contact: Lucie Leistnerova
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-17 10:39 UTC by Duarte Pousa
Modified: 2019-04-29 13:57 UTC (History)
3 users (show)

Fixed In Version: ovirt-engine-4.3.3.6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-04-29 13:57:43 UTC
oVirt Team: Storage
Embargoed:
pm-rhel: ovirt-4.3+
pm-rhel: blocker?


Attachments (Terms of Use)
engine-setup log (6.31 MB, text/plain)
2019-04-17 10:39 UTC, Duarte Pousa
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 99497 0 'None' 'MERGED' 'dbscripts: remove stale image_transfers' 2019-11-15 05:34:22 UTC
oVirt gerrit 99498 0 'None' 'MERGED' 'dbscripts: remove stale image_transfers' 2019-11-15 05:34:22 UTC
oVirt gerrit 99588 0 'None' 'MERGED' 'dbscripts: remove stale image_transfers' 2019-11-15 05:34:22 UTC

Description Duarte Pousa 2019-04-17 10:39:16 UTC
Created attachment 1555806 [details]
engine-setup log

Description of problem:

oVirt engine upgrade fails schema refresh when updating 4.3.2.1 -> 4.3.3


Version-Release number of selected component (if applicable): 4.3.2.1-1.el7


How reproducible:
Should be happening on v4.3.2 engines upon upgrade to v4.3.3

Steps to Reproduce:
1. run engine-setup on a v4.3.2 engine instance
2. allow upgrade procedure to occur

Actual results:

[ INFO  ] Stage: Misc configuration
[ INFO  ] Upgrading CA
[ INFO  ] Creating PostgreSQL 'ovirt_engine_history' database
[ INFO  ] Configuring PostgreSQL
[ INFO  ] Creating/refreshing DWH database schema
[ INFO  ] Configuring Image I/O Proxy
[ INFO  ] Configuring WebSocket Proxy
[ INFO  ] Backing up database localhost:engine to '/var/lib/ovirt-engine/backups/engine-20190417110419.32VRLE.dump'.
[ INFO  ] Creating/refreshing Engine database schema
[ ERROR ] schema.sh: FATAL: Cannot execute sql command: --file=/usr/share/ovirt-engine/dbscripts/upgrade/04_03_0830_add_foreign_key_to_image_transfers.sql
[ ERROR ] Failed to execute stage 'Misc configuration': Engine schema refresh failed

Expected results:

Successful update

Additional info:

After some digging, I think I have found the root cause for this error:

oVirt 4.3.2 schema refresh scripts:
/usr/share/ovirt-engine/dbscripts/upgrade/04_03_0265_remove_foreign_key_in_image_transfers.sql
/usr/share/ovirt-engine/dbscripts/upgrade/04_03_0270_add_foreign_key_to_image_transfers.sql

oVirt 4.3.3 schema refresh scripts:
/usr/share/ovirt-engine/dbscripts/upgrade/04_03_0830_add_foreign_key_to_image_transfers.sql

The constraint name added/removed in v4.3.2 refresh scripts has a typo "fk_image_transfers_command_enitites" vs "fk_image_transfers_command_entities":

ALTER TABLE ONLY image_transfers ADD CONSTRAINT fk_image_transfers_command_enitites FOREIGN KEY (command_id) REFERENCES command_entities(command_id) ON DELETE CASCADE;

Comment 1 RHEL Program Management 2019-04-17 12:31:14 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 2 Lucie Leistnerova 2019-04-24 23:40:07 UTC
Update 4.3.2 -> 4.3.3 with no FK and transfers without appropriate command was successful. FK is present and image_transfers is cleaned.

verified in ovirt-engine-4.3.3.6-0.1.el7.noarch


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