Bug 1399673

Summary: Backup/restore fails to run on an appliances in pglogical replication
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: ApplianceAssignee: Nick Carboni <ncarboni>
Status: CLOSED ERRATA QA Contact: luke couzens <lcouzens>
Severity: high Docs Contact:
Priority: high    
Version: 5.7.0CC: abellott, cpelland, dajohnso, jhardy, lcouzens, ncarboni, obarenbo
Target Milestone: GA   
Target Release: 5.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: black:replication
Fixed In Version: 5.7.0.14 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1393049 Environment:
Last Closed: 2017-01-04 13:17:54 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:
Embargoed:
Bug Depends On: 1393049    
Bug Blocks:    

Comment 3 CFME Bot 2016-11-30 21:31:14 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/d63938f79a946dbd126f8b95a84f1df722e6eab4

commit d63938f79a946dbd126f8b95a84f1df722e6eab4
Author:     Nick Carboni <ncarboni>
AuthorDate: Fri Nov 18 17:10:30 2016 -0500
Commit:     Nick Carboni <ncarboni>
CommitDate: Tue Nov 29 12:27:46 2016 -0500

    Don't test for connections before the restore
    
    The first part of the restore is to drop the database. This will fail
    if there are connections to the database.
    
    Failing before we call restore will also prevent us from fixing
    the situation by removing any pglogical subscriptions that may
    be present before dropping the database.
    
    Instead we can print an error after we fail to inform the user
    that the failure was because there were connections to the database.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1399673

 gems/pending/appliance_console.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comment 4 CFME Bot 2016-11-30 21:31:19 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/1ea75d40417369f3a3b7630f8e48437b98648bb1

commit 1ea75d40417369f3a3b7630f8e48437b98648bb1
Author:     Nick Carboni <ncarboni>
AuthorDate: Fri Nov 18 17:13:00 2016 -0500
Commit:     Nick Carboni <ncarboni>
CommitDate: Tue Nov 29 12:27:55 2016 -0500

    Drop pglogical subscriptions before the restore
    
    pglogical subscriptions cause a postgresql worker process to hold
    open connections to the database. If we attempt to drop the database
    while we still have subscriptions, we will always fail.
    
    This commit removes any existing subscriptions before attempting
    a restore and ignores the failures in the case that pglogical
    is not being used. This allows the database restore to complete
    cleanly.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1399673

 gems/pending/spec/util/postgres_admin_spec.rb |  7 +++++++
 gems/pending/util/postgres_admin.rb           | 14 +++++++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)

Comment 5 luke couzens 2016-12-08 22:17:29 UTC
Verified in 5.7.0.14

Comment 7 errata-xmlrpc 2017-01-04 13:17:54 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://rhn.redhat.com/errata/RHBA-2017-0012.html