From d10c626de47d8b048b663471c7785603a2ec8641 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 11 May 2017 11:49:59 -0400 Subject: [PATCH] Rename WAL-related functions and views to use "lsn" not "location". Per discussion, "location" is a rather vague term that could refer to multiple concepts. "LSN" is an unambiguous term for WAL locations and should be preferred. Some function names, view column names, and function output argument names used "lsn" already, but others used "location", as well as yet other terms such as "wal_position". Since we've already renamed a lot of things in this area from "xlog" to "wal" for v10, we may as well incur a bit more compatibility pain and make these names all consistent. David Rowley, minor additional docs hacking by me Discussion: https://postgr.es/m/CAKJS1f8O0njDKe8ePFQ-LK5-EjwThsDws6ohJ-+c6nWK+oUxtg@mail.gmail.com --- contrib/bloom/t/001_wal.pl | 2 +- contrib/test_decoding/expected/ddl.out | 2 +- contrib/test_decoding/sql/ddl.sql | 2 +- doc/src/sgml/func.sgml | 80 +++++++++---------- doc/src/sgml/high-availability.sgml | 16 ++-- doc/src/sgml/logicaldecoding.sgml | 62 +++++++------- doc/src/sgml/monitoring.sgml | 16 ++-- doc/src/sgml/test-decoding.sgml | 2 +- src/backend/access/transam/xlogfuncs.c | 12 +-- src/backend/catalog/system_views.sql | 20 ++--- src/backend/utils/misc/pg_controldata.c | 12 +-- src/bin/pg_basebackup/t/030_pg_recvlogical.pl | 2 +- src/bin/pg_rewind/RewindTest.pm | 2 +- src/bin/pg_rewind/libpq_fetch.c | 4 +- src/include/catalog/catversion.h | 2 +- src/include/catalog/pg_proc.h | 32 ++++---- src/test/modules/commit_ts/t/002_standby.pl | 8 +- src/test/modules/commit_ts/t/003_standby_2.pl | 4 +- src/test/perl/PostgresNode.pm | 38 ++++----- src/test/recovery/t/002_archiving.pl | 4 +- src/test/recovery/t/003_recovery_targets.pl | 14 ++-- src/test/recovery/t/005_replay_delay.pl | 4 +- src/test/recovery/t/006_logical_decoding.pl | 4 +- src/test/recovery/t/008_fsm_truncation.pl | 4 +- .../t/010_logical_decoding_timelines.pl | 2 +- src/test/regress/expected/rules.out | 10 +-- src/test/subscription/t/001_rep_changes.pl | 2 +- src/test/subscription/t/002_types.pl | 2 +- src/test/subscription/t/003_constraints.pl | 2 +- src/test/subscription/t/004_sync.pl | 2 +- src/test/subscription/t/005_encoding.pl | 2 +- 31 files changed, 185 insertions(+), 185 deletions(-) diff --git a/contrib/bloom/t/001_wal.pl b/contrib/bloom/t/001_wal.pl index dc907baf87b..dbba198254e 100644 --- a/contrib/bloom/t/001_wal.pl +++ b/contrib/bloom/t/001_wal.pl @@ -16,7 +16,7 @@ sub test_index_replay # Wait for standby to catch up my $applname = $node_standby->name; my $caughtup_query = -"SELECT pg_current_wal_location() <= write_location FROM pg_stat_replication WHERE application_name = '$applname';"; +"SELECT pg_current_wal_lsn() <= write_lsn FROM pg_stat_replication WHERE application_name = '$applname';"; $node_master->poll_query_until('postgres', $caughtup_query) or die "Timed out while waiting for standby 1 to catch up"; diff --git a/contrib/test_decoding/expected/ddl.out b/contrib/test_decoding/expected/ddl.out index 275c84a450b..1e22c1eefc1 100644 --- a/contrib/test_decoding/expected/ddl.out +++ b/contrib/test_decoding/expected/ddl.out @@ -58,7 +58,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_d SELECT slot_name, plugin, slot_type, active, NOT catalog_xmin IS NULL AS catalog_xmin_set, xmin IS NULl AS data_xmin_not_set, - pg_wal_location_diff(restart_lsn, '0/01000000') > 0 AS some_wal + pg_wal_lsn_diff(restart_lsn, '0/01000000') > 0 AS some_wal FROM pg_replication_slots; slot_name | plugin | slot_type | active | catalog_xmin_set | data_xmin_not_set | some_wal -----------------+---------------+-----------+--------+------------------+-------------------+---------- diff --git a/contrib/test_decoding/sql/ddl.sql b/contrib/test_decoding/sql/ddl.sql index 49dad39b501..057dae056be 100644 --- a/contrib/test_decoding/sql/ddl.sql +++ b/contrib/test_decoding/sql/ddl.sql @@ -29,7 +29,7 @@ SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot', 'test_d SELECT slot_name, plugin, slot_type, active, NOT catalog_xmin IS NULL AS catalog_xmin_set, xmin IS NULl AS data_xmin_not_set, - pg_wal_location_diff(restart_lsn, '0/01000000') > 0 AS some_wal + pg_wal_lsn_diff(restart_lsn, '0/01000000') > 0 AS some_wal FROM pg_replication_slots; /* diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 629865701fb..4b9a54c0c9e 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -17908,17 +17908,17 @@ SELECT collation for ('foo' COLLATE "de_DE"); - checkpoint_location + checkpoint_lsn pg_lsn - prior_location + prior_lsn pg_lsn - redo_location + redo_lsn pg_lsn @@ -18146,7 +18146,7 @@ SELECT collation for ('foo' COLLATE "de_DE"); - min_recovery_end_location + min_recovery_end_lsn pg_lsn @@ -18156,12 +18156,12 @@ SELECT collation for ('foo' COLLATE "de_DE"); - backup_start_location + backup_start_lsn pg_lsn - backup_end_location + backup_end_lsn pg_lsn @@ -18404,13 +18404,13 @@ SELECT set_config('log_statement_stats', 'off', false); pg_create_restore_point - pg_current_wal_flush_location + pg_current_wal_flush_lsn - pg_current_wal_insert_location + pg_current_wal_insert_lsn - pg_current_wal_location + pg_current_wal_lsn pg_start_backup @@ -18434,7 +18434,7 @@ SELECT set_config('log_statement_stats', 'off', false); pg_walfile_name_offset - pg_wal_location_diff + pg_wal_lsn_diff @@ -18442,7 +18442,7 @@ SELECT set_config('log_statement_stats', 'off', false); linkend="functions-admin-backup-table"> assist in making on-line backups. These functions cannot be executed during recovery (except pg_is_in_backup, pg_backup_start_time - and pg_wal_location_diff). + and pg_wal_lsn_diff). @@ -18463,21 +18463,21 @@ SELECT set_config('log_statement_stats', 'off', false); - pg_current_wal_flush_location() + pg_current_wal_flush_lsn() pg_lsn Get current transaction log flush location - pg_current_wal_insert_location() + pg_current_wal_insert_lsn() pg_lsn Get current transaction log insert location - pg_current_wal_location() + pg_current_wal_lsn() pg_lsn Get current transaction log write location @@ -18526,21 +18526,21 @@ SELECT set_config('log_statement_stats', 'off', false); - pg_walfile_name(location pg_lsn) + pg_walfile_name(lsn pg_lsn) text - Convert transaction log location string to file name + Convert transaction log location to file name - pg_walfile_name_offset(location pg_lsn) + pg_walfile_name_offset(lsn pg_lsn) text, integer - Convert transaction log location string to file name and decimal byte offset within file + Convert transaction log location to file name and decimal byte offset within file - pg_wal_location_diff(location pg_lsn, location pg_lsn) + pg_wal_lsn_diff(lsn pg_lsn, lsn pg_lsn) numeric Calculate the difference between two transaction log locations @@ -18623,17 +18623,17 @@ postgres=# select pg_start_backup('label_goes_here'); - pg_current_wal_location displays the current transaction log write + pg_current_wal_lsn displays the current transaction log write location in the same format used by the above functions. Similarly, - pg_current_wal_insert_location displays the current transaction log - insertion point and pg_current_wal_flush_location displays the - current transaction log flush point. The insertion point is the logical + pg_current_wal_insert_lsn displays the current transaction log + insertion location and pg_current_wal_flush_lsn displays the + current transaction log flush location. The insertion location is the logical end of the transaction log at any instant, while the write location is the end of what has actually been written out from the server's internal buffers and flush location is the location guaranteed to be written to durable storage. The write location is the end of what can be examined from outside the server, and is usually what you want if you are interested in archiving partially-complete transaction log - files. The insertion and flush points are made available primarily for server + files. The insertion and flush locations are made available primarily for server debugging purposes. These are both read-only operations and do not require superuser permissions. @@ -18658,7 +18658,7 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); - pg_wal_location_diff calculates the difference in bytes + pg_wal_lsn_diff calculates the difference in bytes between two transaction log locations. It can be used with pg_stat_replication or some functions shown in to get the replication lag. @@ -18678,10 +18678,10 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); pg_is_in_recovery - pg_last_wal_receive_location + pg_last_wal_receive_lsn - pg_last_wal_replay_location + pg_last_wal_replay_lsn pg_last_xact_replay_timestamp @@ -18713,7 +18713,7 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); - pg_last_wal_receive_location() + pg_last_wal_receive_lsn() pg_lsn Get last transaction log location received and synced to disk by @@ -18727,7 +18727,7 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); - pg_last_wal_replay_location() + pg_last_wal_replay_lsn() pg_lsn Get last transaction log location replayed during recovery. @@ -18950,7 +18950,7 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); pg_create_physical_replication_slot(slot_name name , immediately_reserve boolean, temporary boolean) - (slot_name name, wal_position pg_lsn) + (slot_name name, lsn pg_lsn) Creates a new physical replication slot named @@ -18995,7 +18995,7 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); pg_create_logical_replication_slot(slot_name name, plugin name , temporary boolean) - (slot_name name, wal_position pg_lsn) + (slot_name name, lsn pg_lsn) Creates a new logical (decoding) replication slot named @@ -19018,7 +19018,7 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); pg_logical_slot_get_changes(slot_name name, upto_lsn pg_lsn, upto_nchanges int, VARIADIC options text[]) - (location pg_lsn, xid xid, data text) + (lsn pg_lsn, xid xid, data text) Returns changes in the slot slot_name, starting @@ -19043,7 +19043,7 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); pg_logical_slot_peek_changes(slot_name name, upto_lsn pg_lsn, upto_nchanges int, VARIADIC options text[]) - (location text, xid xid, data text) + (lsn pg_lsn, xid xid, data text) Behaves just like @@ -19061,7 +19061,7 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); pg_logical_slot_get_binary_changes(slot_name name, upto_lsn pg_lsn, upto_nchanges int, VARIADIC options text[]) - (location pg_lsn, xid xid, data bytea) + (lsn pg_lsn, xid xid, data bytea) Behaves just like @@ -19078,7 +19078,7 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); pg_logical_slot_peek_binary_changes(slot_name name, upto_lsn pg_lsn, upto_nchanges int, VARIADIC options text[]) - (location pg_lsn, xid xid, data bytea) + (lsn pg_lsn, xid xid, data bytea) Behaves just like @@ -19197,7 +19197,7 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); pg_lsn - Return the replay position for the replication origin configured in + Return the replay location for the replication origin configured in the current session. The parameter flush determines whether the corresponding local transaction will be guaranteed to have been flushed to disk or not. @@ -19244,15 +19244,15 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); pg_replication_origin_advance - pg_replication_origin_advance(node_name text, pos pg_lsn) + pg_replication_origin_advance(node_name text, lsn pg_lsn) void Set replication progress for the given node to the given - position. This primarily is useful for setting up the initial position - or a new position after configuration changes and similar. Be aware + location. This primarily is useful for setting up the initial location + or a new location after configuration changes and similar. Be aware that careless use of this function can lead to inconsistently replicated data. @@ -19269,7 +19269,7 @@ postgres=# SELECT * FROM pg_walfile_name_offset(pg_stop_backup()); pg_lsn - Return the replay position for the given replication origin. The + Return the replay location for the given replication origin. The parameter flush determines whether the corresponding local transaction will be guaranteed to have been flushed to disk or not. diff --git a/doc/src/sgml/high-availability.sgml b/doc/src/sgml/high-availability.sgml index 22ac10f4284..913f9ae41f5 100644 --- a/doc/src/sgml/high-availability.sgml +++ b/doc/src/sgml/high-availability.sgml @@ -850,9 +850,9 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass' of WAL records generated in the primary, but not yet applied in the standby. You can calculate this lag by comparing the current WAL write location on the primary with the last WAL location received by the - standby. They can be retrieved using - pg_current_wal_location on the primary and the - pg_last_wal_receive_location on the standby, + standby. These locations can be retrieved using + pg_current_wal_lsn on the primary and + pg_last_wal_receive_lsn on the standby, respectively (see and for details). The last WAL receive location in the standby is also displayed in the @@ -863,10 +863,10 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass' You can retrieve a list of WAL sender processes via the pg_stat_replication view. Large differences between - pg_current_wal_location and sent_location field + pg_current_wal_lsn and the view's sent_lsn field might indicate that the master server is under heavy load, while - differences between sent_location and - pg_last_wal_receive_location on the standby might indicate + differences between sent_lsn and + pg_last_wal_receive_lsn on the standby might indicate network delay, or that the standby is under heavy load. @@ -927,8 +927,8 @@ primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass' You can create a replication slot like this: postgres=# SELECT * FROM pg_create_physical_replication_slot('node_a_slot'); - slot_name | wal_position --------------+--------------- + slot_name | lsn +-------------+----- node_a_slot | postgres=# SELECT * FROM pg_replication_slots; diff --git a/doc/src/sgml/logicaldecoding.sgml b/doc/src/sgml/logicaldecoding.sgml index bb22f9ae22d..c2950613fa5 100644 --- a/doc/src/sgml/logicaldecoding.sgml +++ b/doc/src/sgml/logicaldecoding.sgml @@ -56,8 +56,8 @@ postgres=# -- Create a slot named 'regression_slot' using the output plugin 'test_decoding' postgres=# SELECT * FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding'); - slot_name | wal_position ------------------+--------------- + slot_name | lsn +-----------------+----------- regression_slot | 0/16B1970 (1 row) @@ -69,8 +69,8 @@ postgres=# SELECT slot_name, plugin, slot_type, database, active, restart_lsn, c postgres=# -- There are no changes to see yet postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL); - location | xid | data -----------+-----+------ + lsn | xid | data +-----+-----+------ (0 rows) postgres=# CREATE TABLE data(id serial primary key, data text); @@ -78,17 +78,17 @@ CREATE TABLE postgres=# -- DDL isn't replicated, so all you'll see is the transaction postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL); - location | xid | data ------------+-----+------------ - 0/16D5D48 | 688 | BEGIN 688 - 0/16E0380 | 688 | COMMIT 688 + lsn | xid | data +-----------+-------+-------------- + 0/BA2DA58 | 10297 | BEGIN 10297 + 0/BA5A5A0 | 10297 | COMMIT 10297 (2 rows) postgres=# -- Once changes are read, they're consumed and not emitted postgres=# -- in a subsequent call: postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL); - location | xid | data -----------+-----+------ + lsn | xid | data +-----+-----+------ (0 rows) postgres=# BEGIN; @@ -97,41 +97,41 @@ postgres=# INSERT INTO data(data) VALUES('2'); postgres=# COMMIT; postgres=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL); - location | xid | data ------------+-----+----------------------------------------------- - 0/16E0478 | 689 | BEGIN 689 - 0/16E0478 | 689 | table public.data: INSERT: id[integer]:1 data[text]:'1' - 0/16E0580 | 689 | table public.data: INSERT: id[integer]:2 data[text]:'2' - 0/16E0650 | 689 | COMMIT 689 + lsn | xid | data +-----------+-------+--------------------------------------------------------- + 0/BA5A688 | 10298 | BEGIN 10298 + 0/BA5A6F0 | 10298 | table public.data: INSERT: id[integer]:1 data[text]:'1' + 0/BA5A7F8 | 10298 | table public.data: INSERT: id[integer]:2 data[text]:'2' + 0/BA5A8A8 | 10298 | COMMIT 10298 (4 rows) postgres=# INSERT INTO data(data) VALUES('3'); postgres=# -- You can also peek ahead in the change stream without consuming changes postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL); - location | xid | data ------------+-----+----------------------------------------------- - 0/16E09C0 | 690 | BEGIN 690 - 0/16E09C0 | 690 | table public.data: INSERT: id[integer]:3 data[text]:'3' - 0/16E0B90 | 690 | COMMIT 690 + lsn | xid | data +-----------+-------+--------------------------------------------------------- + 0/BA5A8E0 | 10299 | BEGIN 10299 + 0/BA5A8E0 | 10299 | table public.data: INSERT: id[integer]:3 data[text]:'3' + 0/BA5A990 | 10299 | COMMIT 10299 (3 rows) postgres=# -- The next call to pg_logical_slot_peek_changes() returns the same changes again postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL); - location | xid | data ------------+-----+----------------------------------------------- - 0/16E09C0 | 690 | BEGIN 690 - 0/16E09C0 | 690 | table public.data: INSERT: id[integer]:3 data[text]:'3' - 0/16E0B90 | 690 | COMMIT 690 + lsn | xid | data +-----------+-------+--------------------------------------------------------- + 0/BA5A8E0 | 10299 | BEGIN 10299 + 0/BA5A8E0 | 10299 | table public.data: INSERT: id[integer]:3 data[text]:'3' + 0/BA5A990 | 10299 | COMMIT 10299 (3 rows) postgres=# -- options can be passed to output plugin, to influence the formatting postgres=# SELECT * FROM pg_logical_slot_peek_changes('regression_slot', NULL, NULL, 'include-timestamp', 'on'); - location | xid | data ------------+-----+----------------------------------------------- - 0/16E09C0 | 690 | BEGIN 690 - 0/16E09C0 | 690 | table public.data: INSERT: id[integer]:3 data[text]:'3' - 0/16E0B90 | 690 | COMMIT 690 (at 2014-02-27 16:41:51.863092+01) + lsn | xid | data +-----------+-------+--------------------------------------------------------- + 0/BA5A8E0 | 10299 | BEGIN 10299 + 0/BA5A8E0 | 10299 | table public.data: INSERT: id[integer]:3 data[text]:'3' + 0/BA5A990 | 10299 | COMMIT 10299 (at 2017-05-10 12:07:21.272494-04) (3 rows) postgres=# -- Remember to destroy a slot you no longer need to stop it consuming diff --git a/doc/src/sgml/monitoring.sgml b/doc/src/sgml/monitoring.sgml index 80d12b26d77..d5e656f2db8 100644 --- a/doc/src/sgml/monitoring.sgml +++ b/doc/src/sgml/monitoring.sgml @@ -1699,26 +1699,26 @@ SELECT pid, wait_event_type, wait_event FROM pg_stat_activity WHERE wait_event i - sent_location + sent_lsn pg_lsn - Last transaction log position sent on this connection + Last transaction log location sent on this connection - write_location + write_lsn pg_lsn - Last transaction log position written to disk by this standby + Last transaction log location written to disk by this standby server - flush_location + flush_lsn pg_lsn - Last transaction log position flushed to disk by this standby + Last transaction log location flushed to disk by this standby server - replay_location + replay_lsn pg_lsn - Last transaction log position replayed into the database on this + Last transaction log location replayed into the database on this standby server diff --git a/doc/src/sgml/test-decoding.sgml b/doc/src/sgml/test-decoding.sgml index 23cdfe35f8a..4f4fd41e320 100644 --- a/doc/src/sgml/test-decoding.sgml +++ b/doc/src/sgml/test-decoding.sgml @@ -25,7 +25,7 @@ postgres=# SELECT * FROM pg_logical_slot_get_changes('test_slot', NULL, NULL, 'include-xids', '0'); - location | xid | data + lsn | xid | data -----------+-----+-------------------------------------------------- 0/16D30F8 | 691 | BEGIN 0/16D32A0 | 691 | table public.data: INSERT: id[int4]:2 data[text]:'arg' diff --git a/src/backend/access/transam/xlogfuncs.c b/src/backend/access/transam/xlogfuncs.c index 5041f0e2a94..aa47b0dcffc 100644 --- a/src/backend/access/transam/xlogfuncs.c +++ b/src/backend/access/transam/xlogfuncs.c @@ -351,7 +351,7 @@ pg_create_restore_point(PG_FUNCTION_ARGS) * to the kernel, but is not necessarily synced to disk. */ Datum -pg_current_wal_location(PG_FUNCTION_ARGS) +pg_current_wal_lsn(PG_FUNCTION_ARGS) { XLogRecPtr current_recptr; @@ -372,7 +372,7 @@ pg_current_wal_location(PG_FUNCTION_ARGS) * This function is mostly for debugging purposes. */ Datum -pg_current_wal_insert_location(PG_FUNCTION_ARGS) +pg_current_wal_insert_lsn(PG_FUNCTION_ARGS) { XLogRecPtr current_recptr; @@ -393,7 +393,7 @@ pg_current_wal_insert_location(PG_FUNCTION_ARGS) * This function is mostly for debugging purposes. */ Datum -pg_current_wal_flush_location(PG_FUNCTION_ARGS) +pg_current_wal_flush_lsn(PG_FUNCTION_ARGS) { XLogRecPtr current_recptr; @@ -415,7 +415,7 @@ pg_current_wal_flush_location(PG_FUNCTION_ARGS) * and synced to disk by walreceiver. */ Datum -pg_last_wal_receive_location(PG_FUNCTION_ARGS) +pg_last_wal_receive_lsn(PG_FUNCTION_ARGS) { XLogRecPtr recptr; @@ -434,7 +434,7 @@ pg_last_wal_receive_location(PG_FUNCTION_ARGS) * connections during recovery. */ Datum -pg_last_wal_replay_location(PG_FUNCTION_ARGS) +pg_last_wal_replay_lsn(PG_FUNCTION_ARGS) { XLogRecPtr recptr; @@ -621,7 +621,7 @@ pg_is_in_recovery(PG_FUNCTION_ARGS) * Compute the difference in bytes between two WAL locations. */ Datum -pg_wal_location_diff(PG_FUNCTION_ARGS) +pg_wal_lsn_diff(PG_FUNCTION_ARGS) { Datum result; diff --git a/src/backend/catalog/system_views.sql b/src/backend/catalog/system_views.sql index 5cd176bc38e..0fdad0c1197 100644 --- a/src/backend/catalog/system_views.sql +++ b/src/backend/catalog/system_views.sql @@ -724,10 +724,10 @@ CREATE VIEW pg_stat_replication AS S.backend_start, S.backend_xmin, W.state, - W.sent_location, - W.write_location, - W.flush_location, - W.replay_location, + W.sent_lsn, + W.write_lsn, + W.flush_lsn, + W.replay_lsn, W.write_lag, W.flush_lag, W.replay_lag, @@ -1033,7 +1033,7 @@ CREATE OR REPLACE FUNCTION CREATE OR REPLACE FUNCTION pg_logical_slot_get_changes( IN slot_name name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}', - OUT location pg_lsn, OUT xid xid, OUT data text) + OUT lsn pg_lsn, OUT xid xid, OUT data text) RETURNS SETOF RECORD LANGUAGE INTERNAL VOLATILE ROWS 1000 COST 1000 @@ -1041,7 +1041,7 @@ AS 'pg_logical_slot_get_changes'; CREATE OR REPLACE FUNCTION pg_logical_slot_peek_changes( IN slot_name name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}', - OUT location pg_lsn, OUT xid xid, OUT data text) + OUT lsn pg_lsn, OUT xid xid, OUT data text) RETURNS SETOF RECORD LANGUAGE INTERNAL VOLATILE ROWS 1000 COST 1000 @@ -1049,7 +1049,7 @@ AS 'pg_logical_slot_peek_changes'; CREATE OR REPLACE FUNCTION pg_logical_slot_get_binary_changes( IN slot_name name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}', - OUT location pg_lsn, OUT xid xid, OUT data bytea) + OUT lsn pg_lsn, OUT xid xid, OUT data bytea) RETURNS SETOF RECORD LANGUAGE INTERNAL VOLATILE ROWS 1000 COST 1000 @@ -1057,7 +1057,7 @@ AS 'pg_logical_slot_get_binary_changes'; CREATE OR REPLACE FUNCTION pg_logical_slot_peek_binary_changes( IN slot_name name, IN upto_lsn pg_lsn, IN upto_nchanges int, VARIADIC options text[] DEFAULT '{}', - OUT location pg_lsn, OUT xid xid, OUT data bytea) + OUT lsn pg_lsn, OUT xid xid, OUT data bytea) RETURNS SETOF RECORD LANGUAGE INTERNAL VOLATILE ROWS 1000 COST 1000 @@ -1066,7 +1066,7 @@ AS 'pg_logical_slot_peek_binary_changes'; CREATE OR REPLACE FUNCTION pg_create_physical_replication_slot( IN slot_name name, IN immediately_reserve boolean DEFAULT false, IN temporary boolean DEFAULT false, - OUT slot_name name, OUT wal_position pg_lsn) + OUT slot_name name, OUT lsn pg_lsn) RETURNS RECORD LANGUAGE INTERNAL STRICT VOLATILE @@ -1075,7 +1075,7 @@ AS 'pg_create_physical_replication_slot'; CREATE OR REPLACE FUNCTION pg_create_logical_replication_slot( IN slot_name name, IN plugin name, IN temporary boolean DEFAULT false, - OUT slot_name text, OUT wal_position pg_lsn) + OUT slot_name text, OUT lsn pg_lsn) RETURNS RECORD LANGUAGE INTERNAL STRICT VOLATILE diff --git a/src/backend/utils/misc/pg_controldata.c b/src/backend/utils/misc/pg_controldata.c index d8454111a89..56ba301e5a1 100644 --- a/src/backend/utils/misc/pg_controldata.c +++ b/src/backend/utils/misc/pg_controldata.c @@ -91,11 +91,11 @@ pg_control_checkpoint(PG_FUNCTION_ARGS) * function's pg_proc entry! */ tupdesc = CreateTemplateTupleDesc(19, false); - TupleDescInitEntry(tupdesc, (AttrNumber) 1, "checkpoint_location", + TupleDescInitEntry(tupdesc, (AttrNumber) 1, "checkpoint_lsn", LSNOID, -1, 0); - TupleDescInitEntry(tupdesc, (AttrNumber) 2, "prior_location", + TupleDescInitEntry(tupdesc, (AttrNumber) 2, "prior_lsn", LSNOID, -1, 0); - TupleDescInitEntry(tupdesc, (AttrNumber) 3, "redo_location", + TupleDescInitEntry(tupdesc, (AttrNumber) 3, "redo_lsn", LSNOID, -1, 0); TupleDescInitEntry(tupdesc, (AttrNumber) 4, "redo_wal_file", TEXTOID, -1, 0); @@ -225,13 +225,13 @@ pg_control_recovery(PG_FUNCTION_ARGS) * function's pg_proc entry! */ tupdesc = CreateTemplateTupleDesc(5, false); - TupleDescInitEntry(tupdesc, (AttrNumber) 1, "min_recovery_end_location", + TupleDescInitEntry(tupdesc, (AttrNumber) 1, "min_recovery_end_lsn", LSNOID, -1, 0); TupleDescInitEntry(tupdesc, (AttrNumber) 2, "min_recovery_end_timeline", INT4OID, -1, 0); - TupleDescInitEntry(tupdesc, (AttrNumber) 3, "backup_start_location", + TupleDescInitEntry(tupdesc, (AttrNumber) 3, "backup_start_lsn", LSNOID, -1, 0); - TupleDescInitEntry(tupdesc, (AttrNumber) 4, "backup_end_location", + TupleDescInitEntry(tupdesc, (AttrNumber) 4, "backup_end_lsn", LSNOID, -1, 0); TupleDescInitEntry(tupdesc, (AttrNumber) 5, "end_of_backup_record_required", BOOLOID, -1, 0); diff --git a/src/bin/pg_basebackup/t/030_pg_recvlogical.pl b/src/bin/pg_basebackup/t/030_pg_recvlogical.pl index 3e66f70fce7..c036f4ba8b5 100644 --- a/src/bin/pg_basebackup/t/030_pg_recvlogical.pl +++ b/src/bin/pg_basebackup/t/030_pg_recvlogical.pl @@ -39,7 +39,7 @@ isnt($slot->{'restart_lsn'}, '', 'restart lsn is defined for new slot'); $node->psql('postgres', 'CREATE TABLE test_table(x integer)'); $node->psql('postgres', 'INSERT INTO test_table(x) SELECT y FROM generate_series(1, 10) a(y);'); -my $nextlsn = $node->safe_psql('postgres', 'SELECT pg_current_wal_insert_location()'); +my $nextlsn = $node->safe_psql('postgres', 'SELECT pg_current_wal_insert_lsn()'); chomp($nextlsn); $node->command_ok(['pg_recvlogical', '-S', 'test', '-d', $node->connstr('postgres'), '--start', '--endpos', "$nextlsn", '--no-loop', '-f', '-'], diff --git a/src/bin/pg_rewind/RewindTest.pm b/src/bin/pg_rewind/RewindTest.pm index c67212ff7a5..39a559e259c 100644 --- a/src/bin/pg_rewind/RewindTest.pm +++ b/src/bin/pg_rewind/RewindTest.pm @@ -156,7 +156,7 @@ sub promote_standby # Wait for the standby to receive and write all WAL. my $wal_received_query = -"SELECT pg_current_wal_location() = write_location FROM pg_stat_replication WHERE application_name = 'rewind_standby';"; +"SELECT pg_current_wal_lsn() = write_lsn FROM pg_stat_replication WHERE application_name = 'rewind_standby';"; $node_master->poll_query_until('postgres', $wal_received_query) or die "Timed out while waiting for standby to receive and write WAL"; diff --git a/src/bin/pg_rewind/libpq_fetch.c b/src/bin/pg_rewind/libpq_fetch.c index eb74d2f1078..c25367fc49a 100644 --- a/src/bin/pg_rewind/libpq_fetch.c +++ b/src/bin/pg_rewind/libpq_fetch.c @@ -120,7 +120,7 @@ run_simple_query(const char *sql) } /* - * Calls pg_current_wal_insert_location() function + * Calls pg_current_wal_insert_lsn() function */ XLogRecPtr libpqGetCurrentXlogInsertLocation(void) @@ -130,7 +130,7 @@ libpqGetCurrentXlogInsertLocation(void) uint32 lo; char *val; - val = run_simple_query("SELECT pg_current_wal_insert_location()"); + val = run_simple_query("SELECT pg_current_wal_insert_lsn()"); if (sscanf(val, "%X/%X", &hi, &lo) != 2) pg_fatal("unrecognized result \"%s\" for current WAL insert location\n", val); diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h index f1f195518f1..e91479e0893 100644 --- a/src/include/catalog/catversion.h +++ b/src/include/catalog/catversion.h @@ -53,6 +53,6 @@ */ /* yyyymmddN */ -#define CATALOG_VERSION_NO 201705091 +#define CATALOG_VERSION_NO 201705111 #endif diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h index 82562add43a..77d8ed51849 100644 --- a/src/include/catalog/pg_proc.h +++ b/src/include/catalog/pg_proc.h @@ -2830,7 +2830,7 @@ DATA(insert OID = 2022 ( pg_stat_get_activity PGNSP PGUID 12 1 100 0 0 f f f DESCR("statistics: information about currently active backends"); DATA(insert OID = 3318 ( pg_stat_get_progress_info PGNSP PGUID 12 1 100 0 0 f f f f t t s r 1 0 2249 "25" "{25,23,26,26,20,20,20,20,20,20,20,20,20,20}" "{i,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{cmdtype,pid,datid,relid,param1,param2,param3,param4,param5,param6,param7,param8,param9,param10}" _null_ _null_ pg_stat_get_progress_info _null_ _null_ _null_ )); DESCR("statistics: information about progress of backends running maintenance command"); -DATA(insert OID = 3099 ( pg_stat_get_wal_senders PGNSP PGUID 12 1 10 0 0 f f f f f t s r 0 0 2249 "" "{23,25,3220,3220,3220,3220,1186,1186,1186,23,25}" "{o,o,o,o,o,o,o,o,o,o,o}" "{pid,state,sent_location,write_location,flush_location,replay_location,write_lag,flush_lag,replay_lag,sync_priority,sync_state}" _null_ _null_ pg_stat_get_wal_senders _null_ _null_ _null_ )); +DATA(insert OID = 3099 ( pg_stat_get_wal_senders PGNSP PGUID 12 1 10 0 0 f f f f f t s r 0 0 2249 "" "{23,25,3220,3220,3220,3220,1186,1186,1186,23,25}" "{o,o,o,o,o,o,o,o,o,o,o}" "{pid,state,sent_lsn,write_lsn,flush_lsn,replay_lsn,write_lag,flush_lag,replay_lag,sync_priority,sync_state}" _null_ _null_ pg_stat_get_wal_senders _null_ _null_ _null_ )); DESCR("statistics: information about currently active replication"); DATA(insert OID = 3317 ( pg_stat_get_wal_receiver PGNSP PGUID 12 1 0 0 0 f f f f f f s r 0 0 2249 "" "{23,25,3220,23,3220,23,1184,1184,3220,1184,25,25}" "{o,o,o,o,o,o,o,o,o,o,o,o}" "{pid,status,receive_start_lsn,receive_start_tli,received_lsn,received_tli,last_msg_send_time,last_msg_receipt_time,latest_end_lsn,latest_end_time,slot_name,conninfo}" _null_ _null_ pg_stat_get_wal_receiver _null_ _null_ _null_ )); DESCR("statistics: information about WAL receiver"); @@ -3215,18 +3215,18 @@ DATA(insert OID = 2848 ( pg_switch_wal PGNSP PGUID 12 1 0 0 0 f f f f t f v s DESCR("switch to new wal file"); DATA(insert OID = 3098 ( pg_create_restore_point PGNSP PGUID 12 1 0 0 0 f f f f t f v s 1 0 3220 "25" _null_ _null_ _null_ _null_ _null_ pg_create_restore_point _null_ _null_ _null_ )); DESCR("create a named restore point"); -DATA(insert OID = 2849 ( pg_current_wal_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_wal_location _null_ _null_ _null_ )); +DATA(insert OID = 2849 ( pg_current_wal_lsn PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_wal_lsn _null_ _null_ _null_ )); DESCR("current wal write location"); -DATA(insert OID = 2852 ( pg_current_wal_insert_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_wal_insert_location _null_ _null_ _null_ )); +DATA(insert OID = 2852 ( pg_current_wal_insert_lsn PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_wal_insert_lsn _null_ _null_ _null_ )); DESCR("current wal insert location"); -DATA(insert OID = 3330 ( pg_current_wal_flush_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_wal_flush_location _null_ _null_ _null_ )); +DATA(insert OID = 3330 ( pg_current_wal_flush_lsn PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_current_wal_flush_lsn _null_ _null_ _null_ )); DESCR("current wal flush location"); -DATA(insert OID = 2850 ( pg_walfile_name_offset PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2249 "3220" "{3220,25,23}" "{i,o,o}" "{wal_location,file_name,file_offset}" _null_ _null_ pg_walfile_name_offset _null_ _null_ _null_ )); +DATA(insert OID = 2850 ( pg_walfile_name_offset PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 2249 "3220" "{3220,25,23}" "{i,o,o}" "{lsn,file_name,file_offset}" _null_ _null_ pg_walfile_name_offset _null_ _null_ _null_ )); DESCR("wal filename and byte offset, given a wal location"); DATA(insert OID = 2851 ( pg_walfile_name PGNSP PGUID 12 1 0 0 0 f f f f t f i s 1 0 25 "3220" _null_ _null_ _null_ _null_ _null_ pg_walfile_name _null_ _null_ _null_ )); DESCR("wal filename, given a wal location"); -DATA(insert OID = 3165 ( pg_wal_location_diff PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1700 "3220 3220" _null_ _null_ _null_ _null_ _null_ pg_wal_location_diff _null_ _null_ _null_ )); +DATA(insert OID = 3165 ( pg_wal_lsn_diff PGNSP PGUID 12 1 0 0 0 f f f f t f i s 2 0 1700 "3220 3220" _null_ _null_ _null_ _null_ _null_ pg_wal_lsn_diff _null_ _null_ _null_ )); DESCR("difference in bytes, given two wal locations"); DATA(insert OID = 3809 ( pg_export_snapshot PGNSP PGUID 12 1 0 0 0 f f f f t f v u 0 0 25 "" _null_ _null_ _null_ _null_ _null_ pg_export_snapshot _null_ _null_ _null_ )); @@ -3235,9 +3235,9 @@ DESCR("export a snapshot"); DATA(insert OID = 3810 ( pg_is_in_recovery PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 16 "" _null_ _null_ _null_ _null_ _null_ pg_is_in_recovery _null_ _null_ _null_ )); DESCR("true if server is in recovery"); -DATA(insert OID = 3820 ( pg_last_wal_receive_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_last_wal_receive_location _null_ _null_ _null_ )); +DATA(insert OID = 3820 ( pg_last_wal_receive_lsn PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_last_wal_receive_lsn _null_ _null_ _null_ )); DESCR("current wal flush location"); -DATA(insert OID = 3821 ( pg_last_wal_replay_location PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_last_wal_replay_location _null_ _null_ _null_ )); +DATA(insert OID = 3821 ( pg_last_wal_replay_lsn PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 3220 "" _null_ _null_ _null_ _null_ _null_ pg_last_wal_replay_lsn _null_ _null_ _null_ )); DESCR("last wal replay location"); DATA(insert OID = 3830 ( pg_last_xact_replay_timestamp PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 1184 "" _null_ _null_ _null_ _null_ _null_ pg_last_xact_replay_timestamp _null_ _null_ _null_ )); DESCR("timestamp of last replay xact"); @@ -5285,21 +5285,21 @@ DATA(insert OID = 5016 ( spg_box_quad_leaf_consistent PGNSP PGUID 12 1 0 0 0 f DESCR("SP-GiST support for quad tree over box"); /* replication slots */ -DATA(insert OID = 3779 ( pg_create_physical_replication_slot PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 2249 "19 16 16" "{19,16,16,19,3220}" "{i,i,i,o,o}" "{slot_name,immediately_reserve,temporary,slot_name,wal_position}" _null_ _null_ pg_create_physical_replication_slot _null_ _null_ _null_ )); +DATA(insert OID = 3779 ( pg_create_physical_replication_slot PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 2249 "19 16 16" "{19,16,16,19,3220}" "{i,i,i,o,o}" "{slot_name,immediately_reserve,temporary,slot_name,lsn}" _null_ _null_ pg_create_physical_replication_slot _null_ _null_ _null_ )); DESCR("create a physical replication slot"); DATA(insert OID = 3780 ( pg_drop_replication_slot PGNSP PGUID 12 1 0 0 0 f f f f t f v u 1 0 2278 "19" _null_ _null_ _null_ _null_ _null_ pg_drop_replication_slot _null_ _null_ _null_ )); DESCR("drop a replication slot"); DATA(insert OID = 3781 ( pg_get_replication_slots PGNSP PGUID 12 1 10 0 0 f f f f f t s s 0 0 2249 "" "{19,19,25,26,16,16,23,28,28,3220,3220}" "{o,o,o,o,o,o,o,o,o,o,o}" "{slot_name,plugin,slot_type,datoid,temporary,active,active_pid,xmin,catalog_xmin,restart_lsn,confirmed_flush_lsn}" _null_ _null_ pg_get_replication_slots _null_ _null_ _null_ )); DESCR("information about replication slots currently in use"); -DATA(insert OID = 3786 ( pg_create_logical_replication_slot PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 2249 "19 19 16" "{19,19,16,25,3220}" "{i,i,i,o,o}" "{slot_name,plugin,temporary,slot_name,wal_position}" _null_ _null_ pg_create_logical_replication_slot _null_ _null_ _null_ )); +DATA(insert OID = 3786 ( pg_create_logical_replication_slot PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 2249 "19 19 16" "{19,19,16,25,3220}" "{i,i,i,o,o}" "{slot_name,plugin,temporary,slot_name,lsn}" _null_ _null_ pg_create_logical_replication_slot _null_ _null_ _null_ )); DESCR("set up a logical replication slot"); -DATA(insert OID = 3782 ( pg_logical_slot_get_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,25}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,location,xid,data}" _null_ _null_ pg_logical_slot_get_changes _null_ _null_ _null_ )); +DATA(insert OID = 3782 ( pg_logical_slot_get_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,25}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,lsn,xid,data}" _null_ _null_ pg_logical_slot_get_changes _null_ _null_ _null_ )); DESCR("get changes from replication slot"); -DATA(insert OID = 3783 ( pg_logical_slot_get_binary_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,17}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,location,xid,data}" _null_ _null_ pg_logical_slot_get_binary_changes _null_ _null_ _null_ )); +DATA(insert OID = 3783 ( pg_logical_slot_get_binary_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,17}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,lsn,xid,data}" _null_ _null_ pg_logical_slot_get_binary_changes _null_ _null_ _null_ )); DESCR("get binary changes from replication slot"); -DATA(insert OID = 3784 ( pg_logical_slot_peek_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,25}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,location,xid,data}" _null_ _null_ pg_logical_slot_peek_changes _null_ _null_ _null_ )); +DATA(insert OID = 3784 ( pg_logical_slot_peek_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,25}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,lsn,xid,data}" _null_ _null_ pg_logical_slot_peek_changes _null_ _null_ _null_ )); DESCR("peek at changes from replication slot"); -DATA(insert OID = 3785 ( pg_logical_slot_peek_binary_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,17}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,location,xid,data}" _null_ _null_ pg_logical_slot_peek_binary_changes _null_ _null_ _null_ )); +DATA(insert OID = 3785 ( pg_logical_slot_peek_binary_changes PGNSP PGUID 12 1000 1000 25 0 f f f f f t v u 4 0 2249 "19 3220 23 1009" "{19,3220,23,1009,3220,28,17}" "{i,i,i,v,o,o,o}" "{slot_name,upto_lsn,upto_nchanges,options,lsn,xid,data}" _null_ _null_ pg_logical_slot_peek_binary_changes _null_ _null_ _null_ )); DESCR("peek at binary changes from replication slot"); DATA(insert OID = 3577 ( pg_logical_emit_message PGNSP PGUID 12 1 0 0 0 f f f f t f v u 3 0 3220 "16 25 25" _null_ _null_ _null_ _null_ _null_ pg_logical_emit_message_text _null_ _null_ _null_ )); DESCR("emit a textual logical decoding message"); @@ -5447,10 +5447,10 @@ DESCR("pg_config binary as a function"); DATA(insert OID = 3441 ( pg_control_system PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{23,23,20,1184}" "{o,o,o,o}" "{pg_control_version,catalog_version_no,system_identifier,pg_control_last_modified}" _null_ _null_ pg_control_system _null_ _null_ _null_ )); DESCR("pg_controldata general state information as a function"); -DATA(insert OID = 3442 ( pg_control_checkpoint PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{3220,3220,3220,25,23,23,16,25,26,28,28,28,26,28,28,26,28,28,1184}" "{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{checkpoint_location,prior_location,redo_location,redo_wal_file,timeline_id,prev_timeline_id,full_page_writes,next_xid,next_oid,next_multixact_id,next_multi_offset,oldest_xid,oldest_xid_dbid,oldest_active_xid,oldest_multi_xid,oldest_multi_dbid,oldest_commit_ts_xid,newest_commit_ts_xid,checkpoint_time}" _null_ _null_ pg_control_checkpoint _null_ _null_ _null_ )); +DATA(insert OID = 3442 ( pg_control_checkpoint PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{3220,3220,3220,25,23,23,16,25,26,28,28,28,26,28,28,26,28,28,1184}" "{o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}" "{checkpoint_lsn,prior_lsn,redo_lsn,redo_wal_file,timeline_id,prev_timeline_id,full_page_writes,next_xid,next_oid,next_multixact_id,next_multi_offset,oldest_xid,oldest_xid_dbid,oldest_active_xid,oldest_multi_xid,oldest_multi_dbid,oldest_commit_ts_xid,newest_commit_ts_xid,checkpoint_time}" _null_ _null_ pg_control_checkpoint _null_ _null_ _null_ )); DESCR("pg_controldata checkpoint state information as a function"); -DATA(insert OID = 3443 ( pg_control_recovery PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{3220,23,3220,3220,16}" "{o,o,o,o,o}" "{min_recovery_end_location,min_recovery_end_timeline,backup_start_location,backup_end_location,end_of_backup_record_required}" _null_ _null_ pg_control_recovery _null_ _null_ _null_ )); +DATA(insert OID = 3443 ( pg_control_recovery PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{3220,23,3220,3220,16}" "{o,o,o,o,o}" "{min_recovery_end_lsn,min_recovery_end_timeline,backup_start_lsn,backup_end_lsn,end_of_backup_record_required}" _null_ _null_ pg_control_recovery _null_ _null_ _null_ )); DESCR("pg_controldata recovery state information as a function"); DATA(insert OID = 3444 ( pg_control_init PGNSP PGUID 12 1 0 0 0 f f f f t f v s 0 0 2249 "" "{23,23,23,23,23,23,23,23,23,16,16,23}" "{o,o,o,o,o,o,o,o,o,o,o,o}" "{max_data_alignment,database_block_size,blocks_per_segment,wal_block_size,bytes_per_wal_segment,max_identifier_length,max_index_columns,max_toast_chunk_size,large_object_chunk_size,float4_pass_by_value,float8_pass_by_value,data_page_checksum_version}" _null_ _null_ pg_control_init _null_ _null_ _null_ )); diff --git a/src/test/modules/commit_ts/t/002_standby.pl b/src/test/modules/commit_ts/t/002_standby.pl index 203b75d35bc..e7221e982be 100644 --- a/src/test/modules/commit_ts/t/002_standby.pl +++ b/src/test/modules/commit_ts/t/002_standby.pl @@ -31,9 +31,9 @@ my $master_ts = $master->safe_psql('postgres', qq{SELECT ts.* FROM pg_class, pg_xact_commit_timestamp(xmin) AS ts WHERE relname = 't10'} ); my $master_lsn = - $master->safe_psql('postgres', 'select pg_current_wal_location()'); + $master->safe_psql('postgres', 'select pg_current_wal_lsn()'); $standby->poll_query_until('postgres', - qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_location()}) + qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_lsn()}) or die "slave never caught up"; my $standby_ts = $standby->safe_psql('postgres', @@ -45,9 +45,9 @@ $master->append_conf('postgresql.conf', 'track_commit_timestamp = off'); $master->restart; $master->safe_psql('postgres', 'checkpoint'); $master_lsn = - $master->safe_psql('postgres', 'select pg_current_wal_location()'); + $master->safe_psql('postgres', 'select pg_current_wal_lsn()'); $standby->poll_query_until('postgres', - qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_location()}) + qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_lsn()}) or die "slave never caught up"; $standby->safe_psql('postgres', 'checkpoint'); diff --git a/src/test/modules/commit_ts/t/003_standby_2.pl b/src/test/modules/commit_ts/t/003_standby_2.pl index d7898b83556..2fd561115cb 100644 --- a/src/test/modules/commit_ts/t/003_standby_2.pl +++ b/src/test/modules/commit_ts/t/003_standby_2.pl @@ -30,9 +30,9 @@ $master->append_conf('postgresql.conf', 'track_commit_timestamp = off'); $master->restart; $master->safe_psql('postgres', 'checkpoint'); my $master_lsn = - $master->safe_psql('postgres', 'select pg_current_wal_location()'); + $master->safe_psql('postgres', 'select pg_current_wal_lsn()'); $standby->poll_query_until('postgres', - qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_location()}) + qq{SELECT '$master_lsn'::pg_lsn <= pg_last_wal_replay_lsn()}) or die "slave never caught up"; $standby->safe_psql('postgres', 'checkpoint'); diff --git a/src/test/perl/PostgresNode.pm b/src/test/perl/PostgresNode.pm index 51cbec8e5d9..e2274681b10 100644 --- a/src/test/perl/PostgresNode.pm +++ b/src/test/perl/PostgresNode.pm @@ -1347,13 +1347,13 @@ sub run_log =item $node->lsn(mode) -Look up WAL positions on the server: +Look up WAL locations on the server: - * insert position (master only, error on replica) - * write position (master only, error on replica) - * flush position (master only, error on replica) - * receive position (always undef on master) - * replay position (always undef on master) + * insert location (master only, error on replica) + * write location (master only, error on replica) + * flush location (master only, error on replica) + * receive location (always undef on master) + * replay location (always undef on master) mode must be specified. @@ -1362,11 +1362,11 @@ mode must be specified. sub lsn { my ($self, $mode) = @_; - my %modes = ('insert' => 'pg_current_wal_insert_location()', - 'flush' => 'pg_current_wal_flush_location()', - 'write' => 'pg_current_wal_location()', - 'receive' => 'pg_last_wal_receive_location()', - 'replay' => 'pg_last_wal_replay_location()'); + my %modes = ('insert' => 'pg_current_wal_insert_lsn()', + 'flush' => 'pg_current_wal_flush_lsn()', + 'write' => 'pg_current_wal_lsn()', + 'receive' => 'pg_last_wal_receive_lsn()', + 'replay' => 'pg_last_wal_replay_lsn()'); $mode = '' if !defined($mode); die "unknown mode for 'lsn': '$mode', valid modes are " . join(', ', keys %modes) @@ -1389,10 +1389,10 @@ sub lsn =item $node->wait_for_catchup(standby_name, mode, target_lsn) Wait for the node with application_name standby_name (usually from node->name) -until its replication position in pg_stat_replication equals or passes the +until its replication location in pg_stat_replication equals or passes the upstream's WAL insert point at the time this function is called. By default -the replay_location is waited for, but 'mode' may be specified to wait for any -of sent|write|flush|replay. +the replay_lsn is waited for, but 'mode' may be specified to wait for any of +sent|write|flush|replay. If there is no active replication connection from this peer, waits until poll_query_until timeout. @@ -1417,10 +1417,10 @@ sub wait_for_catchup $standby_name = $standby_name->name; } die 'target_lsn must be specified' unless defined($target_lsn); - print "Waiting for replication conn " . $standby_name . "'s " . $mode . "_location to pass " . $target_lsn . " on " . $self->name . "\n"; - my $query = qq[SELECT '$target_lsn' <= ${mode}_location FROM pg_catalog.pg_stat_replication WHERE application_name = '$standby_name';]; + print "Waiting for replication conn " . $standby_name . "'s " . $mode . "_lsn to pass " . $target_lsn . " on " . $self->name . "\n"; + my $query = qq[SELECT '$target_lsn' <= ${mode}_lsn FROM pg_catalog.pg_stat_replication WHERE application_name = '$standby_name';]; $self->poll_query_until('postgres', $query) - or die "timed out waiting for catchup, current position is " . ($self->safe_psql('postgres', $query) || '(unknown)'); + or die "timed out waiting for catchup, current location is " . ($self->safe_psql('postgres', $query) || '(unknown)'); print "done\n"; } @@ -1429,7 +1429,7 @@ sub wait_for_catchup =item $node->wait_for_slot_catchup(slot_name, mode, target_lsn) Wait for the named replication slot to equal or pass the supplied target_lsn. -The position used is the restart_lsn unless mode is given, in which case it may +The location used is the restart_lsn unless mode is given, in which case it may be 'restart' or 'confirmed_flush'. Requires that the 'postgres' db exists and is accessible. @@ -1456,7 +1456,7 @@ sub wait_for_slot_catchup print "Waiting for replication slot " . $slot_name . "'s " . $mode . "_lsn to pass " . $target_lsn . " on " . $self->name . "\n"; my $query = qq[SELECT '$target_lsn' <= ${mode}_lsn FROM pg_catalog.pg_replication_slots WHERE slot_name = '$slot_name';]; $self->poll_query_until('postgres', $query) - or die "timed out waiting for catchup, current position is " . ($self->safe_psql('postgres', $query) || '(unknown)'); + or die "timed out waiting for catchup, current location is " . ($self->safe_psql('postgres', $query) || '(unknown)'); print "done\n"; } diff --git a/src/test/recovery/t/002_archiving.pl b/src/test/recovery/t/002_archiving.pl index e4a643d82d2..42a9afb2f34 100644 --- a/src/test/recovery/t/002_archiving.pl +++ b/src/test/recovery/t/002_archiving.pl @@ -31,7 +31,7 @@ $node_standby->start; $node_master->safe_psql('postgres', "CREATE TABLE tab_int AS SELECT generate_series(1,1000) AS a"); my $current_lsn = - $node_master->safe_psql('postgres', "SELECT pg_current_wal_location();"); + $node_master->safe_psql('postgres', "SELECT pg_current_wal_lsn();"); # Force archiving of WAL file to make it present on master $node_master->safe_psql('postgres', "SELECT pg_switch_wal()"); @@ -42,7 +42,7 @@ $node_master->safe_psql('postgres', # Wait until necessary replay has been done on standby my $caughtup_query = - "SELECT '$current_lsn'::pg_lsn <= pg_last_wal_replay_location()"; + "SELECT '$current_lsn'::pg_lsn <= pg_last_wal_replay_lsn()"; $node_standby->poll_query_until('postgres', $caughtup_query) or die "Timed out while waiting for standby to catch up"; diff --git a/src/test/recovery/t/003_recovery_targets.pl b/src/test/recovery/t/003_recovery_targets.pl index 203a46419e0..66025cdbe3e 100644 --- a/src/test/recovery/t/003_recovery_targets.pl +++ b/src/test/recovery/t/003_recovery_targets.pl @@ -30,7 +30,7 @@ sub test_recovery_standby # Wait until standby has replayed enough data my $caughtup_query = - "SELECT '$until_lsn'::pg_lsn <= pg_last_wal_replay_location()"; + "SELECT '$until_lsn'::pg_lsn <= pg_last_wal_replay_lsn()"; $node_standby->poll_query_until('postgres', $caughtup_query) or die "Timed out while waiting for standby to catch up"; @@ -55,7 +55,7 @@ $node_master->start; $node_master->safe_psql('postgres', "CREATE TABLE tab_int AS SELECT generate_series(1,1000) AS a"); my $lsn1 = - $node_master->safe_psql('postgres', "SELECT pg_current_wal_location();"); + $node_master->safe_psql('postgres', "SELECT pg_current_wal_lsn();"); # Take backup from which all operations will be run $node_master->backup('my_backup'); @@ -65,14 +65,14 @@ $node_master->backup('my_backup'); $node_master->safe_psql('postgres', "INSERT INTO tab_int VALUES (generate_series(1001,2000))"); my $ret = $node_master->safe_psql('postgres', - "SELECT pg_current_wal_location(), txid_current();"); + "SELECT pg_current_wal_lsn(), txid_current();"); my ($lsn2, $recovery_txid) = split /\|/, $ret; # More data, with recovery target timestamp $node_master->safe_psql('postgres', "INSERT INTO tab_int VALUES (generate_series(2001,3000))"); $ret = $node_master->safe_psql('postgres', - "SELECT pg_current_wal_location(), now();"); + "SELECT pg_current_wal_lsn(), now();"); my ($lsn3, $recovery_time) = split /\|/, $ret; # Even more data, this time with a recovery target name @@ -80,16 +80,16 @@ $node_master->safe_psql('postgres', "INSERT INTO tab_int VALUES (generate_series(3001,4000))"); my $recovery_name = "my_target"; my $lsn4 = - $node_master->safe_psql('postgres', "SELECT pg_current_wal_location();"); + $node_master->safe_psql('postgres', "SELECT pg_current_wal_lsn();"); $node_master->safe_psql('postgres', "SELECT pg_create_restore_point('$recovery_name');"); # And now for a recovery target LSN $node_master->safe_psql('postgres', "INSERT INTO tab_int VALUES (generate_series(4001,5000))"); -my $recovery_lsn = $node_master->safe_psql('postgres', "SELECT pg_current_wal_location()"); +my $recovery_lsn = $node_master->safe_psql('postgres', "SELECT pg_current_wal_lsn()"); my $lsn5 = - $node_master->safe_psql('postgres', "SELECT pg_current_wal_location();"); + $node_master->safe_psql('postgres', "SELECT pg_current_wal_lsn();"); $node_master->safe_psql('postgres', "INSERT INTO tab_int VALUES (generate_series(5001,6000))"); diff --git a/src/test/recovery/t/005_replay_delay.pl b/src/test/recovery/t/005_replay_delay.pl index cd9e8f5c12f..4185f58e0d8 100644 --- a/src/test/recovery/t/005_replay_delay.pl +++ b/src/test/recovery/t/005_replay_delay.pl @@ -42,7 +42,7 @@ $node_master->safe_psql('postgres', # Now wait for replay to complete on standby. We're done waiting when the # slave has replayed up to the previously saved master LSN. my $until_lsn = - $node_master->safe_psql('postgres', "SELECT pg_current_wal_location()"); + $node_master->safe_psql('postgres', "SELECT pg_current_wal_lsn()"); my $remaining = 90; while ($remaining-- > 0) @@ -50,7 +50,7 @@ while ($remaining-- > 0) # Done waiting? my $replay_status = $node_standby->safe_psql('postgres', - "SELECT (pg_last_wal_replay_location() - '$until_lsn'::pg_lsn) >= 0" + "SELECT (pg_last_wal_replay_lsn() - '$until_lsn'::pg_lsn) >= 0" ); last if $replay_status eq 't'; diff --git a/src/test/recovery/t/006_logical_decoding.pl b/src/test/recovery/t/006_logical_decoding.pl index bf9b50a6a35..31b1218cc06 100644 --- a/src/test/recovery/t/006_logical_decoding.pl +++ b/src/test/recovery/t/006_logical_decoding.pl @@ -53,7 +53,7 @@ COMMIT}; my $stdout_sql = $node_master->safe_psql('postgres', qq[SELECT data FROM pg_logical_slot_peek_changes('test_slot', NULL, NULL, 'include-xids', '0', 'skip-empty-xacts', '1');]); is($stdout_sql, $expected, 'got expected output from SQL decoding session'); -my $endpos = $node_master->safe_psql('postgres', "SELECT location FROM pg_logical_slot_peek_changes('test_slot', NULL, NULL) ORDER BY location DESC LIMIT 1;"); +my $endpos = $node_master->safe_psql('postgres', "SELECT lsn FROM pg_logical_slot_peek_changes('test_slot', NULL, NULL) ORDER BY lsn DESC LIMIT 1;"); print "waiting to replay $endpos\n"; my $stdout_recv = $node_master->pg_recvlogical_upto('postgres', 'test_slot', $endpos, 10, 'include-xids' => '0', 'skip-empty-xacts' => '1'); @@ -66,7 +66,7 @@ is($stdout_recv, '', 'pg_recvlogical acknowledged changes, nothing pending on sl $node_master->safe_psql('postgres', 'CREATE DATABASE otherdb'); -is($node_master->psql('otherdb', "SELECT location FROM pg_logical_slot_peek_changes('test_slot', NULL, NULL) ORDER BY location DESC LIMIT 1;"), 3, +is($node_master->psql('otherdb', "SELECT lsn FROM pg_logical_slot_peek_changes('test_slot', NULL, NULL) ORDER BY lsn DESC LIMIT 1;"), 3, 'replaying logical slot from another database fails'); $node_master->safe_psql('otherdb', qq[SELECT pg_create_logical_replication_slot('otherdb_slot', 'test_decoding');]); diff --git a/src/test/recovery/t/008_fsm_truncation.pl b/src/test/recovery/t/008_fsm_truncation.pl index 8aa8a4fe821..055cac324c5 100644 --- a/src/test/recovery/t/008_fsm_truncation.pl +++ b/src/test/recovery/t/008_fsm_truncation.pl @@ -68,11 +68,11 @@ vacuum verbose testtab; $node_master->psql('postgres', 'checkpoint'); my $until_lsn = - $node_master->safe_psql('postgres', "SELECT pg_current_wal_location();"); + $node_master->safe_psql('postgres', "SELECT pg_current_wal_lsn();"); # Wait long enough for standby to receive and apply all WAL my $caughtup_query = - "SELECT '$until_lsn'::pg_lsn <= pg_last_wal_replay_location()"; + "SELECT '$until_lsn'::pg_lsn <= pg_last_wal_replay_lsn()"; $node_standby->poll_query_until('postgres', $caughtup_query) or die "Timed out while waiting for standby to catch up"; diff --git a/src/test/recovery/t/010_logical_decoding_timelines.pl b/src/test/recovery/t/010_logical_decoding_timelines.pl index cdddb4d13d4..e168cbc161a 100644 --- a/src/test/recovery/t/010_logical_decoding_timelines.pl +++ b/src/test/recovery/t/010_logical_decoding_timelines.pl @@ -169,7 +169,7 @@ is($stderr, '', 'replay from slot before_basebackup produces no stderr'); # pg_recvlogical we should get complete results. First, find out the commit lsn # of the last transaction. There's no max(pg_lsn), so: -my $endpos = $node_replica->safe_psql('postgres', "SELECT location FROM pg_logical_slot_peek_changes('before_basebackup', NULL, NULL) ORDER BY location DESC LIMIT 1;"); +my $endpos = $node_replica->safe_psql('postgres', "SELECT lsn FROM pg_logical_slot_peek_changes('before_basebackup', NULL, NULL) ORDER BY lsn DESC LIMIT 1;"); # now use the walsender protocol to peek the slot changes and make sure we see # the same results. diff --git a/src/test/regress/expected/rules.out b/src/test/regress/expected/rules.out index 259b26b6f73..a4b2d8635dc 100644 --- a/src/test/regress/expected/rules.out +++ b/src/test/regress/expected/rules.out @@ -1851,17 +1851,17 @@ pg_stat_replication| SELECT s.pid, s.backend_start, s.backend_xmin, w.state, - w.sent_location, - w.write_location, - w.flush_location, - w.replay_location, + w.sent_lsn, + w.write_lsn, + w.flush_lsn, + w.replay_lsn, w.write_lag, w.flush_lag, w.replay_lag, w.sync_priority, w.sync_state FROM ((pg_stat_get_activity(NULL::integer) s(datid, pid, usesysid, application_name, state, query, wait_event_type, wait_event, xact_start, query_start, backend_start, state_change, client_addr, client_hostname, client_port, backend_xid, backend_xmin, backend_type, ssl, sslversion, sslcipher, sslbits, sslcompression, sslclientdn) - JOIN pg_stat_get_wal_senders() w(pid, state, sent_location, write_location, flush_location, replay_location, write_lag, flush_lag, replay_lag, sync_priority, sync_state) ON ((s.pid = w.pid))) + JOIN pg_stat_get_wal_senders() w(pid, state, sent_lsn, write_lsn, flush_lsn, replay_lsn, write_lag, flush_lag, replay_lag, sync_priority, sync_state) ON ((s.pid = w.pid))) LEFT JOIN pg_authid u ON ((s.usesysid = u.oid))); pg_stat_ssl| SELECT s.pid, s.ssl, diff --git a/src/test/subscription/t/001_rep_changes.pl b/src/test/subscription/t/001_rep_changes.pl index 8e79fa3c44b..ea99f84534c 100644 --- a/src/test/subscription/t/001_rep_changes.pl +++ b/src/test/subscription/t/001_rep_changes.pl @@ -52,7 +52,7 @@ $node_subscriber->safe_psql('postgres', # Wait for subscriber to finish initialization my $caughtup_query = -"SELECT pg_current_wal_location() <= replay_location FROM pg_stat_replication WHERE application_name = '$appname';"; +"SELECT pg_current_wal_lsn() <= replay_lsn FROM pg_stat_replication WHERE application_name = '$appname';"; $node_publisher->poll_query_until('postgres', $caughtup_query) or die "Timed out while waiting for subscriber to catch up"; diff --git a/src/test/subscription/t/002_types.pl b/src/test/subscription/t/002_types.pl index ad15e85c0ca..16e8b478855 100644 --- a/src/test/subscription/t/002_types.pl +++ b/src/test/subscription/t/002_types.pl @@ -107,7 +107,7 @@ $node_subscriber->safe_psql('postgres', # Wait for subscriber to finish initialization my $caughtup_query = -"SELECT pg_current_wal_location() <= replay_location FROM pg_stat_replication WHERE application_name = '$appname';"; +"SELECT pg_current_wal_lsn() <= replay_lsn FROM pg_stat_replication WHERE application_name = '$appname';"; $node_publisher->poll_query_until('postgres', $caughtup_query) or die "Timed out while waiting for subscriber to catch up"; diff --git a/src/test/subscription/t/003_constraints.pl b/src/test/subscription/t/003_constraints.pl index 11b82541551..074fdb1a30c 100644 --- a/src/test/subscription/t/003_constraints.pl +++ b/src/test/subscription/t/003_constraints.pl @@ -38,7 +38,7 @@ $node_subscriber->safe_psql('postgres', # Wait for subscriber to finish initialization my $caughtup_query = -"SELECT pg_current_wal_location() <= replay_location FROM pg_stat_replication WHERE application_name = '$appname';"; +"SELECT pg_current_wal_lsn() <= replay_lsn FROM pg_stat_replication WHERE application_name = '$appname';"; $node_publisher->poll_query_until('postgres', $caughtup_query) or die "Timed out while waiting for subscriber to catch up"; diff --git a/src/test/subscription/t/004_sync.pl b/src/test/subscription/t/004_sync.pl index fa0bf7f49fc..ceeb7a3b5d0 100644 --- a/src/test/subscription/t/004_sync.pl +++ b/src/test/subscription/t/004_sync.pl @@ -37,7 +37,7 @@ $node_subscriber->safe_psql('postgres', # Wait for subscriber to finish initialization my $caughtup_query = -"SELECT pg_current_wal_location() <= replay_location FROM pg_stat_replication WHERE application_name = '$appname';"; +"SELECT pg_current_wal_lsn() <= replay_lsn FROM pg_stat_replication WHERE application_name = '$appname';"; $node_publisher->poll_query_until('postgres', $caughtup_query) or die "Timed out while waiting for subscriber to catch up"; diff --git a/src/test/subscription/t/005_encoding.pl b/src/test/subscription/t/005_encoding.pl index 42a4eee5b4d..7a62e05cc6b 100644 --- a/src/test/subscription/t/005_encoding.pl +++ b/src/test/subscription/t/005_encoding.pl @@ -10,7 +10,7 @@ sub wait_for_caught_up my ($node, $appname) = @_; $node->poll_query_until('postgres', - "SELECT pg_current_wal_location() <= replay_location FROM pg_stat_replication WHERE application_name = '$appname';") + "SELECT pg_current_wal_lsn() <= replay_lsn FROM pg_stat_replication WHERE application_name = '$appname';") or die "Timed out while waiting for subscriber to catch up"; } -- 2.39.5