Skip to content

Commit

Permalink
do not attempt to calculate backlog unless subscription in replicatin…
Browse files Browse the repository at this point in the history
  • Loading branch information
yrudman committed Sep 4, 2019
1 parent 004033c commit f964e0b
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions app/models/pglogical_subscription.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,16 @@ def validate(new_connection_params = {})
end

def backlog
connection.xlog_location_diff(remote_node_lsn, remote_replication_lsn)
rescue PG::Error => e
_log.error(e.message)
nil
if status != "replicating"
_log.error("Please check that database `#{dbname}` is running on host `#{host}` and accepting TCP/IP connections on port #{port}")
return nil
end
begin
connection.xlog_location_diff(remote_node_lsn, remote_replication_lsn)
rescue PG::Error => e
_log.error(e.message)
nil
end
end

# translate the output from the pglogical stored proc to our object columns
Expand Down

0 comments on commit f964e0b

Please sign in to comment.