v2-0001-Fix-race-in-032_relfilenode_reuse.pl.patch

application/octet-stream

Filename: v2-0001-Fix-race-in-032_relfilenode_reuse.pl.patch
Type: application/octet-stream
Part: 0
Message: Re: Support logical replication of DDLs

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: format-patch
Series: patch v2-0001
Subject: Fix race in 032_relfilenode_reuse.pl.
File+
src/test/recovery/t/032_relfilenode_reuse.pl 5 3
From a22652ebbcb33a6a271cc69841ad61d971d7db30 Mon Sep 17 00:00:00 2001
From: Thomas Munro <tmunro@postgresql.org>
Date: Sun, 8 May 2022 16:54:09 +1200
Subject: [PATCH v2 1/2] Fix race in 032_relfilenode_reuse.pl.

Add wait_for_catchup() call to the test added by commit e2f65f42.  Per
slow build farm animal grison.

Also fix a comment.

Discussion: https://postgr.es/m/CA%2BhUKGLJ2Vy8hVQmnYotmTaEKZK0%3D-GcXgNAgcHzArZvtS4L_g%40mail.gmail.com
---
 src/test/recovery/t/032_relfilenode_reuse.pl | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/test/recovery/t/032_relfilenode_reuse.pl b/src/test/recovery/t/032_relfilenode_reuse.pl
index 22d8e85..ac9340b 100644
--- a/src/test/recovery/t/032_relfilenode_reuse.pl
+++ b/src/test/recovery/t/032_relfilenode_reuse.pl
@@ -72,6 +72,8 @@ $node_primary->safe_psql('postgres', q[
     CREATE TABLE replace_sb(data text);
     INSERT INTO replace_sb(data) SELECT random()::text FROM generate_series(1, 15000);]);
 
+$node_primary->wait_for_catchup($node_standby);
+
 # Use longrunning transactions, so that AtEOXact_SMgr doesn't close files
 send_query_and_wait(
 	\%psql_primary,
@@ -101,9 +103,9 @@ verify($node_primary, $node_standby, 1,
 # value so we can check everything is OK
 $node_primary->safe_psql('conflict_db', "UPDATE large SET datab = 2;");
 
-# Again cause a lot of IO. That'll again write back dirty data, but uses (XXX
-# adjust after bugfix) the already opened file descriptor.
-# FIXME
+# Again cause a lot of IO. That'll again write back dirty data, but uses newly
+# opened file descriptors, so we don't confuse old files with new files despite
+# recycling relfilenodes.
 cause_eviction(\%psql_primary, \%psql_standby);
 
 verify($node_primary, $node_standby, 2,
-- 
1.8.3.1