Skip to content

Commit 88089fc

Browse files
committed
Fix check_replication_slots on recently promoted servers
Addresses parts of bucardo#163.
1 parent 0d16893 commit 88089fc

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

check_postgres.pl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5707,7 +5707,11 @@ sub check_replication_slots {
57075707
WITH slots AS (SELECT slot_name,
57085708
slot_type,
57095709
coalesce(restart_lsn, '0/0'::pg_lsn) AS slot_lsn,
5710-
coalesce(pg_xlog_location_diff(coalesce(pg_last_xlog_receive_location(), pg_current_xlog_location()), restart_lsn),0) AS delta,
5710+
coalesce(
5711+
pg_xlog_location_diff(
5712+
case when pg_is_in_recovery() then pg_last_xlog_receive_location() else pg_current_xlog_location() end,
5713+
restart_lsn),
5714+
0) AS delta,
57115715
active
57125716
FROM pg_replication_slots)
57135717
SELECT *, pg_size_pretty(delta) AS delta_pretty FROM slots;
@@ -10989,6 +10993,10 @@ =head1 HISTORY
1098910993
1099010994
=over 4
1099110995
10996+
=item B<Version 2.25.1> Released ??, 2020
10997+
10998+
Fix check_replication_slots on recently promoted servers (Christoph Berg)
10999+
1099211000
=item B<Version 2.25.0> Released February 3, 2020
1099311001
1099411002
Allow same_schema objects to be included or excluded with --object and --skipobject

0 commit comments

Comments
 (0)