Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0b84f5c

Browse filesBrowse files
author
Amit Kapila
committed
Fix a random failure in 038_save_logical_slots_shutdown.pl.
The test ensures that all the WAL on the publisher is sent to the subscriber before shutdown by comparing the confirmed_flush_lsn of the associated slot with the shutdown_checkpoint WAL location. But if the shutdown_checkpoint location falls into a new page in the WAL then the check won't work. So, ensure that the shutdown_checkpoint WAL record doesn't fall into a new page. Reported-by: Bharath Rupireddy Author: Bharath Rupireddy Reviewed-by: Vignesh C, Kuroda Hayato, Amit Kapila Discussion: https://postgr.es/m/CALj2ACVLzH5CN-h9=S26mdRHPuJ9yDLUw70yh4JOiPw03WL0CQ@mail.gmail.com
1 parent 0265e5c commit 0b84f5c
Copy full SHA for 0b84f5c

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed

‎src/test/recovery/t/038_save_logical_slots_shutdown.pl

Copy file name to clipboardExpand all lines: src/test/recovery/t/038_save_logical_slots_shutdown.pl
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ sub compare_confirmed_flush
6060
$node_publisher->safe_psql('postgres', "CREATE TABLE test_tbl (id int)");
6161
$node_subscriber->safe_psql('postgres', "CREATE TABLE test_tbl (id int)");
6262

63+
# To avoid a shutdown checkpoint WAL record (that gets generated as part of
64+
# the publisher restart below) falling into a new page, advance the WAL
65+
# segment. Otherwise, the confirmed_flush_lsn and shutdown_checkpoint
66+
# location won't match.
67+
$node_publisher->advance_wal(1);
68+
6369
# Insert some data
6470
$node_publisher->safe_psql('postgres',
6571
"INSERT INTO test_tbl VALUES (generate_series(1, 5));");
@@ -81,6 +87,10 @@ sub compare_confirmed_flush
8187

8288
my $offset = -s $node_publisher->logfile;
8389

90+
# Note: Don't insert any data on the publisher that may cause the shutdown
91+
# checkpoint to fall into a new WAL file. See the comments atop advance_wal()
92+
# above.
93+
8494
# Restart the publisher to ensure that the slot will be flushed if required
8595
$node_publisher->restart();
8696

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.