Bug 1673784

Summary: postgresql plugin support to PG10
Product: Red Hat Enterprise Linux 7 Reporter: Douglas Schilling Landgraf <dougsland>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED ERRATA QA Contact: Miroslav HradĂ­lek <mhradile>
Severity: urgent Docs Contact:
Priority: high    
Version: 7.6CC: agk, bmr, gavin, gveitmic, jcoscia, jhunsaker, plambri, sbradley, sfroemer, toneata
Target Milestone: rcKeywords: OtherQA, ZStream
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sos-3.7-1.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1715470 (view as bug list) Environment:
Last Closed: 2019-08-06 13:15:47 UTC 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: 1658509, 1715470    

Description Douglas Schilling Landgraf 2019-02-08 04:22:21 UTC
Description of problem:

RHV 4.3 uses PostgreSQL 10, postgresql.py plugin has static value for scl (rh-postgresql95) and no package rh-postgresql10-postgresql-server listed.

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

sos-3.6-13.el7_6.noarch
sos-3.6-14.el7_6.noarch

How reproducible:

- Install RHV 4.3
- run ovirt-log-collector 

It will generate sos_commands/postgresql/pgdump-scl-rh-postgresql95.tar instead of sos_commands/postgresql/pgdump-scl-rh-postgresql10.tar

$ file pgdump-scl-rh-postgresql95.tar 
pgdump-scl-rh-postgresql95.tar: ASCII text

$ cat pgdump-scl-rh-postgresql95.tar 
pg_dump: server version: 10.6; pg_dump version: 9.5.14
pg_dump: aborting because of server version mismatch

Additional info:

# rpm -qa | grep ovirt-log-collector
ovirt-log-collector-4.3.0-1.el7ev.noarch

We should look which postgresql server is enabled and set the scl accordingly, example:

# systemctl list-unit-files | grep postgres 
rh-postgresql10-postgresql.service            enabled 
rh-postgresql10-postgresql@.service           disabled
rh-postgresql95-postgresql.service            disabled
rh-postgresql95-postgresql@.service           disabled

# systemctl list-unit-files | awk '/postgres/ && /enable/' | awk -F '.' '/1/ {print $1}'
rh-postgresql10-postgresql

Comment 2 Jake Hunsaker 2019-02-08 18:24:45 UTC
Proposed upstream sos PR for this: https://github.com/sosreport/sos/pull/1562

Comment 3 Jake Hunsaker 2019-02-08 18:36:32 UTC
Note on the above PR:

The "proper" fix for this can be solved by using sos' `init_system.get_service_status()` which was added after the sos-3.6 release here - https://github.com/sosreport/sos/commit/6db459e2b21a798d93cc79e705e8e02f1bbd24c1

As this will allow us to check for either the 10 or 9.5 scl being *active* rather than just present. I'm not sure if it's feasible to backport the above patch to 7.6 at this point, so the previous PR in c2 is a stop-gap measure until the init system capabilities of sos are present in RHEL (probably RHEL 7.7 / sos-3.7).

Comment 4 Pavel Moravec 2019-02-18 08:41:32 UTC
devel_ack+ for 7.7. We should do rebase to sos-3.7 so PR 1387 for the commit 6db459e will be included.

Updating `SCLPlugin` per Bryn's comment should be easy.

Comment 5 Pavel Moravec 2019-03-21 11:08:25 UTC
POSTed to upstream.

Comment 17 errata-xmlrpc 2019-08-06 13:15:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2019:2295