This service will be undergoing maintenance at 00:00 UTC, 2017-10-23 It is expected to last about 30 minutes
Bug 1013341 - DB upgrade from 3.2 to 3.3 fails
DB upgrade from 3.2 to 3.3 fails
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine (Show other bugs)
3.3.0
Unspecified Unspecified
urgent Severity high
: ---
: 3.3.0
Assigned To: Moti Asayag
yeylon@redhat.com
network
: AutomationBlocker, Regression
Depends On:
Blocks: 1019461
  Show dependency treegraph
 
Reported: 2013-09-29 08:37 EDT by Eli Mesika
Modified: 2016-04-18 02:59 EDT (History)
10 users (show)

See Also:
Fixed In Version: is17
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Network
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
3.2 database (2.14 MB, application/x-tar)
2013-09-29 08:41 EDT, Eli Mesika
no flags Details
port mirroring is enabled (VM_Network_35_pm) (60.78 KB, image/png)
2013-10-02 10:08 EDT, awinter
no flags Details
port mirroring is enabled (VM_Network_35_pm) (60.78 KB, image/png)
2013-10-02 10:09 EDT, awinter
no flags Details
port mirroring is enabled (VM_Network_35_pm) (72.76 KB, image/png)
2013-10-02 10:10 EDT, awinter
no flags Details
Network was created with two profiles: one for pm and no for not. (70.23 KB, image/png)
2013-10-02 10:11 EDT, awinter
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 19656 None None None Never

  None (edit)
Description Eli Mesika 2013-09-29 08:37:05 EDT
Description of problem:

upgrade script  03_03_0710_add_profile_to_network_interface.sql has the following code :

--START--

Create or replace FUNCTION __temp_has_port_mirroring_vm_interfaces(v_network_id UUID) RETURNS BOOLEAN
   AS $procedure$
BEGIN
   RETURN ((SELECT 1
   FROM vm_interface
   INNER JOIN vm_static
   ON vm_static.vm_guid = vm_interface.vm_guid
   INNER JOIN network_cluster
   ON network_cluster.cluster_id = vm_static.vds_group_id
   INNER JOIN network
   ON network.id = network_cluster.network_id
   AND network.name = vm_interface.network_name
   WHERE network.id = v_network_id
   AND port_mirroring = TRUE) IS NOT NULL);
END; $procedure$
LANGUAGE plpgsql;

--END--

When this function is called, it expects to return one value which is boolean.
On the attached database more than one row is returned and breaks the upgrade as you can see in the log:

psql:upgrade/03_03_0710_add_profile_to_network_interface.sql:80: ERROR:  more than one row returned by a subquery used as an expression
CONTEXT:  SQL statement "SELECT  ((SELECT 1 FROM vm_interface INNER JOIN vm_static ON vm_static.vm_guid = vm_interface.vm_guid INNER JOIN network_cluster ON network_cluster.cluster_id = vm_static.vds_group_id INNER JOIN network ON network.id = network_cluster.network_id AND network.name = vm_interface.network_name WHERE network.id =  $1  AND port_mirroring = TRUE) IS NOT NULL)"
PL/pgSQL function "__temp_has_port_mirroring_vm_interfaces" line 2 at RETURN


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Restore 3.3 database from attached file using pg_restore
2. Try to upgrade manually to 3.3 using upgrade.sh
3.

Actual results:
Upgrade fails with ERROR:  more than one row returned by a subquery used as an expression

Expected results:
Upgrade should complete successfully 

Additional info:
Comment 1 Eli Mesika 2013-09-29 08:41:08 EDT
Created attachment 804672 [details]
3.2 database
Comment 2 Eli Mesika 2013-09-29 08:42:50 EDT
(In reply to Eli Mesika from comment #0)
sorry , should be:

Steps to Reproduce:
1. Restore 3.2 database from attached file using pg_restore
2. Try to upgrade manually to 3.3 using upgrade.sh
3.
Comment 3 awinter 2013-10-02 10:08:06 EDT
Created attachment 806503 [details]
port mirroring is enabled (VM_Network_35_pm)
Comment 4 awinter 2013-10-02 10:09:30 EDT
Created attachment 806504 [details]
port mirroring is enabled (VM_Network_35_pm)

Verified.
Screen shot 1 of 3
Comment 5 awinter 2013-10-02 10:10:47 EDT
Created attachment 806505 [details]
port mirroring is enabled (VM_Network_35_pm)

Verified.
Screen shot 2 of 3
Comment 6 awinter 2013-10-02 10:11:59 EDT
Created attachment 806517 [details]
Network was created with two profiles: one for pm and no for not.

Verified.
Screen shot 3 of 3
Comment 7 awinter 2013-10-02 10:12:47 EDT
Verified.
See attachments.
Comment 9 Itamar Heim 2014-01-21 17:32:17 EST
Closing - RHEV 3.3 Released
Comment 10 Itamar Heim 2014-01-21 17:32:20 EST
Closing - RHEV 3.3 Released

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