Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use new replication gem #18686

Merged
merged 23 commits into from
May 15, 2019
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8cec170
s/REPLICATION_SET_NAME/PUBLICATION_NAME/
carbonin Apr 23, 2019
c826707
Use the new logical replication gem in MiqPglogical
carbonin Apr 23, 2019
1bb5deb
Remove the MiqRegion.replication_enabled? method
carbonin Apr 23, 2019
07b0570
Update PglogicalSubscription model to use new logical replication gem
carbonin Apr 24, 2019
eb98464
Add new replication gem to Gemfile
carbonin Apr 24, 2019
cf8fa22
Rename MiqPglogical @connection instance var to @pg_connection
carbonin Apr 29, 2019
b0795d9
Use the #subscriber? method from the client gem
carbonin Apr 29, 2019
ff604b4
Use the #publishes? method for MiqPglogical#provider?
carbonin Apr 29, 2019
ea9167b
Move the MiqPglogical spec into the regular location
carbonin Apr 29, 2019
81ddc80
Use the new config handler for logical replication failover
carbonin Apr 29, 2019
27365fd
Resync all subscriptions after migrating the database
carbonin Apr 29, 2019
c7fbecf
Use the new client gem in the migration patch
carbonin Apr 29, 2019
03d599a
Fix spec for logical replication HA config handler
carbonin Apr 30, 2019
916c65f
Don't try to wait for pglogical connections to go away on restore
carbonin Apr 30, 2019
0772830
Disable and unset the subscription slot if the publisher is unreachable
carbonin May 6, 2019
c620596
Use worker count to determine subscription status
carbonin May 7, 2019
b8ea358
Only list subscriptions from the current database
carbonin May 7, 2019
1b98b69
Remove user-configurable excluded tables
carbonin May 7, 2019
157b452
Don't use "default" for excludes now that we can't change them
carbonin May 7, 2019
1d02c05
Use released pg-logical_replication
carbonin May 8, 2019
ef12780
Use version 3.1.0 of manageiq-postgres_ha_admin
carbonin May 9, 2019
336bcb1
Add a transaction around the multi-step error-case subscription delete
carbonin May 13, 2019
eed3a50
Rename PglogicalSubscription#subscription_status to subscription_attr…
carbonin May 13, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Rename PglogicalSubscription#subscription_status to subscription_attr…
…ibutes

We have a .subscription_status method that actually returns the
status of a subscription based on the number of workers and the
enabled attribute.

The instance method is actually returning a new copy of the current
subscription's attirubtes for fetching things like the current wal
location or the password so we can more accurately name it
subscription_attributes
  • Loading branch information
carbonin committed May 13, 2019
commit eed3a504bc9ef091718d62cf6bf60cbef001967e
6 changes: 3 additions & 3 deletions app/models/pglogical_subscription.rb
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ def validate(new_connection_params = {})
end

def backlog
connection.xlog_location_diff(remote_region_lsn, subscription_status["remote_replication_lsn"])
connection.xlog_location_diff(remote_region_lsn, subscription_attributes["remote_replication_lsn"])
rescue PG::Error => e
_log.error(e.message)
nil
@@ -220,7 +220,7 @@ def update_subscription
# sets this instance's password field to the one in the subscription dsn in the database
def find_password
return password if password.present?
s = subscription_status.symbolize_keys
s = subscription_attributes.symbolize_keys
dsn_hash = PG::DSNParser.parse(s.delete(:subscription_dsn))
self.password = dsn_hash[:password]
end
@@ -262,7 +262,7 @@ def with_remote_connection
end
end

def subscription_status
def subscription_attributes
pglogical.subscriptions.find { |s| s["subscription_name"] == id }
end
end