agora inbox for [email protected]
help / color / mirror / Atom feedFrom: Jehan-Guillaume de Rorthais <[email protected]>
Subject: [PATCH 2/2] Add test on non archived WAL during crash recovery
Date: Wed, 1 Apr 2020 18:12:17 +0200
---
src/test/recovery/t/011_crash_recovery.pl | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/src/test/recovery/t/011_crash_recovery.pl b/src/test/recovery/t/011_crash_recovery.pl
index ca6e92b50d..ce2e899891 100644
--- a/src/test/recovery/t/011_crash_recovery.pl
+++ b/src/test/recovery/t/011_crash_recovery.pl
@@ -15,11 +15,17 @@ if ($Config{osname} eq 'MSWin32')
}
else
{
- plan tests => 3;
+ plan tests => 4;
}
my $node = get_new_node('master');
-$node->init(allows_streaming => 1);
+$node->init(
+ has_archiving => 1,
+ allows_streaming => 1);
+
+$node->append_conf('postgresql.conf',
+ "archive_command = ''");
+
$node->start;
my ($stdin, $stdout, $stderr) = ('', '', '');
@@ -43,6 +49,7 @@ $stdin .= q[
BEGIN;
CREATE TABLE mine(x integer);
SELECT pg_current_xact_id();
+SELECT pg_switch_wal();
];
$tx->pump until $stdout =~ /[[:digit:]]+[\r\n]$/;
@@ -65,4 +72,9 @@ cmp_ok($node->safe_psql('postgres', 'SELECT pg_current_xact_id()'),
is($node->safe_psql('postgres', qq[SELECT pg_xact_status('$xid');]),
'aborted', 'xid is aborted after crash');
+# make WAL are still waiting to be archived
+my $node_data = $node->data_dir;
+ok( -f "$node_data/pg_wal/archive_status/000000010000000000000001.ready",
+ "WAL still waiting to be archived");
+
$tx->kill_kill;
--
2.20.1
--MP_/L1DZ8JxHo5T3rROFDeOBxW8--
view thread (4+ messages)
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 2/2] Add test on non archived WAL during crash recovery
In-Reply-To: <no-message-id-1881421@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