Bug 1385157

Summary: Configuring pglogical replication after setting up HA fails
Product: Red Hat CloudForms Management Engine Reporter: Nick Carboni <ncarboni>
Component: ReplicationAssignee: Nick Carboni <ncarboni>
Status: CLOSED CURRENTRELEASE QA Contact: Alex Newman <anewman>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.7.0CC: cpelland, jhardy, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly
Target Release: 5.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.8.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1386770 (view as bug list) Environment:
Last Closed: 2017-06-12 16:57:18 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:
Bug Depends On:    
Bug Blocks: 1386770    

Description Nick Carboni 2016-10-14 20:21:01 UTC
Description of problem:
Attempting to configure pglogical replication (setting replication type to remote) on a database which was previously configured as a HA cluster (using repmgr) fails with the following error:

Error during replication configuration save: ERROR: table repl_monitor cannot be added to replication set miq DETAIL: table does not have PRIMARY KEY and given replication set is configured to replicate UPDATEs and/or DELETEs HINT: Add a PRIMARY KEY to the table

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

This is happening because we are attempting to add the repmgr internal tables to the replication set and those tables do not all have primary keys.

We should never replicate these tables to the global region, so they should be excluded.

Comment 4 CFME Bot 2016-10-18 21:26:08 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/a3d87b41557c1cc974c0bb35ed1f14238ca13a5a

commit a3d87b41557c1cc974c0bb35ed1f14238ca13a5a
Author:     Nick Carboni <ncarboni>
AuthorDate: Fri Oct 14 16:26:51 2016 -0400
Commit:     Nick Carboni <ncarboni>
CommitDate: Tue Oct 18 14:51:33 2016 -0400

    Add repmgr tables to replication excludes
    
    We don't control the structure or contents of these tables, so we
    cannot replicate them.
    
    They are in a different schema, but we need them accessible without
    being fully qualified because the schema name is dependent on the region
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1385157

 config/settings.yml | 3 +++
 1 file changed, 3 insertions(+)

Comment 5 CFME Bot 2016-10-19 04:27:07 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/bce8d4928c1a83ca8952a39a2597e1a2c70ff807

commit bce8d4928c1a83ca8952a39a2597e1a2c70ff807
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Tue Oct 18 17:23:22 2016 -0400
Commit:     Oleg Barenboim <chessbyte>
CommitDate: Tue Oct 18 23:23:08 2016 -0500

    Merge pull request #11959 from carbonin/add_repmgr_tables_to_replication_excludes
    
    Add repmgr tables to replication excludes
    (cherry picked from commit c5167997d2cc5c801cf3f599edc49fc049a2123c)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1385157

 app/models/miq_region.rb                    | 2 +-
 config/settings.yml                         | 3 +++
 lib/miq_pglogical.rb                        | 3 ++-
 spec/replication/util/miq_pglogical_spec.rb | 3 ++-
 4 files changed, 8 insertions(+), 3 deletions(-)