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

Commitce197e9

Browse files
committed
Close yet another race condition in replication slot test code
Buildfarm shows that this test has a further failure mode when acheckpoint starts earlier than expected, so we detect a "checkpointcompleted" line that's not the one we want. Change the config to tryand prevent this.Per buildfarmWhile at it, update one comment that was forgotten in commitd18e756.Author: Kyotaro Horiguchi <horikyota.ntt@gmail.com>Discussion:https://postgr.es/m/20210729.162038.534808353849568395.horikyota.ntt@gmail.com
1 parentfcf4c0a commitce197e9

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9329,7 +9329,7 @@ CreateCheckPoint(int flags)
93299329
if (!RecoveryInProgress())
93309330
TruncateSUBTRANS(GetOldestTransactionIdConsideredRunning());
93319331

9332-
/* Real work is done, butlog and update stats before releasing lock. */
9332+
/* Real work is done;log and update stats. */
93339333
LogCheckpointEnd(false);
93349334

93359335
/* Reset the process title */

‎src/test/recovery/t/019_replslot_limit.pl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,21 @@
173173
"requested WAL segment [0-9A-F]+ has already been removed"),
174174
'check that required WAL segments are still available');
175175

176-
# Advance WAL again, the slot loses the oldest segment.
176+
# Create one checkpoint, to improve stability of the next steps
177+
$node_primary->safe_psql('postgres',"CHECKPOINT;");
178+
179+
# Prevent other checkpoints from occurring while advancing WAL segments
180+
$node_primary->safe_psql('postgres',
181+
"ALTER SYSTEM SET max_wal_size='40MB'; SELECT pg_reload_conf()");
182+
183+
# Advance WAL again. The slot loses the oldest segment by the next checkpoint
177184
my$logstart = get_log_size($node_primary);
178185
advance_wal($node_primary, 7);
179186

180-
# wait until the WARNING is issued
187+
# Now create another checkpoint and wait until the WARNING is issued
188+
$node_primary->safe_psql('postgres',
189+
'ALTER SYSTEM RESET max_wal_size; SELECT pg_reload_conf()');
190+
$node_primary->safe_psql('postgres',"CHECKPOINT;");
181191
my$invalidated = 0;
182192
for (my$i = 0;$i < 10000;$i++)
183193
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp