Bug 1455262

Summary: Use PostgreSQL JDBC drivers 9.2 on Fedora until regression found on newer versions is fixed
Product: [oVirt] ovirt-engine Reporter: Fabrice Bacchella <fabrice.bacchella>
Component: Packaging.rpmAssignee: Martin Perina <mperina>
Status: CLOSED CURRENTRELEASE QA Contact: Lukas Svaty <lsvaty>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.1.1.8CC: bugs, logank, lsvaty, mperina, sbonazzo, stirabos
Target Milestone: ovirt-4.1.3Flags: rule-engine: ovirt-4.1+
lsvaty: testing_ack+
Target Release: 4.1.3.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-07-06 13:20:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Fabrice Bacchella 2017-05-24 14:55:19 UTC
Managing postgres version on ovirt is dangerous.

It requires pg_dump to run the exact same version up to the minor than the pg server. So installation with centralized up to date postgress will need to install yum repository from Postgress and so yum's rpm. For me, it's postgresql94-9.4.11-2PGDG.rhel7.x86_64 :
cat /etc/yum.repos.d/pgdg-94-centos.repo
[pgdg94]
name=PostgreSQL 9.4 $releasever - $basearch
baseurl=https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7.3-$basearch
...


But by doing this, postgresql-jdbc is also coming from the same repo and brake ovirt. It happens to me twice, and I needed to add:
cat /etc/yum.repos.d/pgdg-94-centos.repo
[pgdg94]
...
exclude=postgresql-jdbc

To avoid this problem, two solution:

Provided directly postgresql-jdbc.jar in ovirt's rpm, it's already the case for a lot of them:

lsof -p 12233 | grep REG | grep -e '/usr/share/ovirt-engine/modules/.*\.jar' -e '/usr/share/java/ovirt-engine/.*\.jar' | wc -l
84

Much more than the rpm's provided one:
lsof -p 12233 | grep REG | grep '/usr/share/java/.*\.jar' | grep -v '/usr/share/java/ovirt-engine' | wc -l
26

Another solution is to add in the spec files:
'Requires: postgresql-jdbc < 9.3'

At least it would break during yum upgrade, avoiding fear and despair when oVirt fails to start with a database error.
That solution was proposed by Didi.

Comment 1 Martin Perina 2017-05-25 07:32:17 UTC
Right now any PostgreSQL JDBC drivers newer than 9.2 break engine DAL layer, so we need to prevent using newer JDBC drivers available only on Fedora and ship correct version within engine on Fedora until Fedora packages are fixed.

Comment 2 Martin Perina 2017-05-25 13:14:18 UTC
*** Bug 1455331 has been marked as a duplicate of this bug. ***

Comment 3 Logan Kuhn 2017-06-01 13:06:32 UTC
Same for Centos 7.3.1611, update postgresql-jdbc past 9.2 and it can no longer talk to the database.

Comment 4 Martin Perina 2017-06-01 13:15:04 UTC
(In reply to Logan Kuhn from comment #3)
> Same for Centos 7.3.1611, update postgresql-jdbc past 9.2 and it can no
> longer talk to the database.

Right, we don't officially support any PostgreSQL version other than 9.2 (although except this JDBC drivers issue it should work), so you should use on CentOS only 9.2 provided by OS. Unfortunately Fedora 24 upgraded PostgreSQL to 9.4/9.5 already so we need to stop using RPMs provided by Fedora.

Support for PostgreSQL 9.5 is currently being prepared for oVirt 4.2

Comment 5 Lukas Svaty 2017-06-06 06:42:09 UTC
verified in ovirt-engine-4.1.3.1-0.1.el7.noarch

--> Processing Conflict: ovirt-engine-4.1.3.1-0.1.el7.noarch conflicts postgresql-jdbc >= 9.3