Skip to content

Commit

Permalink
Enable the pglogical extension and create the replication set in a tr…
Browse files Browse the repository at this point in the history
…ansaction

This will allow us to rollback the whole process if something
bad happens while creating the replication set (like a unique
constraint error).

After this change we will no longer see the replication type as
"Remote" when we fail to cleanly create the provider node.

https://bugzilla.redhat.com/show_bug.cgi?id=1380475
  • Loading branch information
carbonin committed Nov 8, 2016
1 parent 39a2f8b commit 34efdcc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/miq_pglogical.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ def drop_node
# node and creating the replication set
def configure_provider
return if provider?
pglogical.enable
create_node unless node?
create_replication_set
@connection.transaction(:requires_new => true) do
pglogical.enable
create_node unless node?
create_replication_set
end
end

# Removes the replication configuration and pglogical node from the
Expand Down

0 comments on commit 34efdcc

Please sign in to comment.