Skip to content

Commit

Permalink
Fix check_replication_slots on recently promoted servers
Browse files Browse the repository at this point in the history
Addresses parts of bucardo#163.
  • Loading branch information
df7cb committed Jun 24, 2020
1 parent 0d16893 commit 88089fc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion check_postgres.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5707,7 +5707,11 @@ sub check_replication_slots {
WITH slots AS (SELECT slot_name,
slot_type,
coalesce(restart_lsn, '0/0'::pg_lsn) AS slot_lsn,
coalesce(pg_xlog_location_diff(coalesce(pg_last_xlog_receive_location(), pg_current_xlog_location()), restart_lsn),0) AS delta,
coalesce(
pg_xlog_location_diff(
case when pg_is_in_recovery() then pg_last_xlog_receive_location() else pg_current_xlog_location() end,
restart_lsn),
0) AS delta,
active
FROM pg_replication_slots)
SELECT *, pg_size_pretty(delta) AS delta_pretty FROM slots;
Expand Down Expand Up @@ -10989,6 +10993,10 @@ =head1 HISTORY
=over 4
=item B<Version 2.25.1> Released ??, 2020
Fix check_replication_slots on recently promoted servers (Christoph Berg)
=item B<Version 2.25.0> Released February 3, 2020
Allow same_schema objects to be included or excluded with --object and --skipobject
Expand Down

0 comments on commit 88089fc

Please sign in to comment.