($INBOX_DIR/description missing)  
help / color / mirror / Atom feed
From: Kyotaro Horiguchi <[email protected]>
Subject: [PATCH 4/4] Additional test for new GUC setting.
Date: Wed, 28 Aug 2019 14:12:18 +0900

This patchset adds new GUC variable effective_io_block_size that
controls wheter WAL-skipped tables are finally WAL-logged or
fcync'ed. All of the TAP test performs WAL-logging so this adds an
item that performs file sync.
---
 src/test/recovery/t/018_wal_optimize.pl | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/test/recovery/t/018_wal_optimize.pl b/src/test/recovery/t/018_wal_optimize.pl
index b041121745..95063ab131 100644
--- a/src/test/recovery/t/018_wal_optimize.pl
+++ b/src/test/recovery/t/018_wal_optimize.pl
@@ -11,7 +11,7 @@ use warnings;
 
 use PostgresNode;
 use TestLib;
-use Test::More tests => 26;
+use Test::More tests => 28;
 
 sub check_orphan_relfilenodes
 {
@@ -102,7 +102,23 @@ max_prepared_transactions = 1
 	$result = $node->safe_psql('postgres', "SELECT count(*) FROM test2a;");
 	is($result, qq(1),
 	   "wal_level = $wal_level, optimized truncation with prepared transaction");
+	# Same for file sync mode
+	# Tuples inserted after the truncation should be seen.
+	$node->safe_psql('postgres', "
+		SET effective_io_block_size to 0;
+		BEGIN;
+		CREATE TABLE test2b (id serial PRIMARY KEY);
+		INSERT INTO test2b VALUES (DEFAULT);
+		TRUNCATE test2b;
+		INSERT INTO test2b VALUES (DEFAULT);
+		COMMIT;");
 
+	$node->stop('immediate');
+	$node->start;
+
+	$result = $node->safe_psql('postgres', "SELECT count(*) FROM test2b;");
+	is($result, qq(1),
+	   "wal_level = $wal_level, optimized truncation with file-sync");
 
 	# Data file for COPY query in follow-up tests.
 	my $basedir = $node->basedir;
-- 
2.16.3


----Next_Part(Wed_Aug_28_15_42_10_2019_037)----





view thread (27+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: [PATCH 4/4] Additional test for new GUC setting.
  In-Reply-To: <no-message-id-1882145@localhost>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox