Bug 1395306

Summary: postgres upgrade script fails for 5.6 -5.7
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: ApplianceAssignee: Nick Carboni <ncarboni>
Status: CLOSED CURRENTRELEASE QA Contact: luke couzens <lcouzens>
Severity: high Docs Contact:
Priority: high    
Version: 5.7.0CC: abellott, cpelland, dajohnso, jhardy, obarenbo
Target Milestone: GAKeywords: TestOnly
Target Release: 5.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: black:upgrade:migration:replication
Fixed In Version: 5.7.0.11 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1391693 Environment:
Last Closed: 2017-01-11 19:58:02 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Bug Depends On: 1391693    
Bug Blocks:    

Comment 2 luke couzens 2016-11-16 10:40:34 UTC
It seems there is another issue with the upgrade script across all appliances (single or replicated) after running the upgrade script and making edits to postgres, postgres fails to start. 

systemctl enable rh-postgresql95-postgresql.service && systemctl start rh-postgresql95-postgresql.service
Job for rh-postgresql95-postgresql.service failed because the control process exited with error code. See "systemctl status rh-postgresql95-postgresql.service" and "journalctl -xe" for details.

Additional info:
● rh-postgresql95-postgresql.service - PostgreSQL database server
   Loaded: loaded (/usr/lib/systemd/system/rh-postgresql95-postgresql.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2016-11-16 05:09:59 EST; 1min 0s ago
  Process: 39832 ExecStart=/opt/rh/rh-postgresql95/root/usr/libexec/postgresql-ctl start -D ${PGDATA} -s -w -t ${PGSTARTTIMEOUT} (code=exited, status=1/FAILURE)
  Process: 39829 ExecStartPre=/opt/rh/rh-postgresql95/root/usr/libexec/postgresql-check-db-dir %N (code=exited, status=0/SUCCESS)

Nsystemd[1]: Starting PostgreSQL database server...
postgresql-ctl[39832]: LOG:  unrecognized configuration parameter "checkpoint_segments" in file "/var/opt/rh/rh-postgresql95/lib/pgsql/data/po...f" line 186
postgresql-ctl[39832]: FATAL:  configuration file "/var/opt/rh/rh-postgresql95/lib/pgsql/data/postgresql.conf" contains errors
postgresql-ctl[39832]: pg_ctl: could not start server
systemd[1]: rh-postgresql95-postgresql.service: control process exited, code=exited status=1
systemd[1]: Failed to start PostgreSQL database server.
systemd[1]: Unit rh-postgresql95-postgresql.service entered failed state.
systemd[1]: rh-postgresql95-postgresql.service failed.


line 186 would be checkpoint_segments = 15               # MIQ Value;

If I comment out this line then postgres starts and I can start evm.

Another note to point out is while running this I didnt actually add that line it was already in postgres.conf

Comment 3 Nick Carboni 2016-11-16 14:16:00 UTC
You still need to make the edits in the patch printed at the end of the script run for this to work.

This fix does not add automatic editing of the file after the old configuration is copied from the 9.4 cluster to the 9.5. That change is being tracked in https://bugzilla.redhat.com/show_bug.cgi?id=1391557

Comment 4 luke couzens 2016-11-16 15:53:45 UTC
Verified in 5.7.0.11