Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit0b84f5c

Browse 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 thesubscriber before shutdown by comparing the confirmed_flush_lsn of theassociated slot with the shutdown_checkpoint WAL location. But if theshutdown_checkpoint location falls into a new page in the WAL then thecheck won't work. So, ensure that the shutdown_checkpoint WAL recorddoesn't fall into a new page.Reported-by: Bharath RupireddyAuthor: Bharath RupireddyReviewed-by: Vignesh C, Kuroda Hayato, Amit KapilaDiscussion:https://postgr.es/m/CALj2ACVLzH5CN-h9=S26mdRHPuJ9yDLUw70yh4JOiPw03WL0CQ@mail.gmail.com
1 parent0265e5c commit0b84f5c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines 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)

[8]ページ先頭

©2009-2025 Movatter.jp