pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedattached TAP test is hanging
2+ messages / 2 participants
[nested] [flat]
* attached TAP test is hanging
@ 2020-05-15 03:36 Mahendra Singh Thalor <mahi6run@gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: Mahendra Singh Thalor @ 2020-05-15 03:36 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org
Hi All,
While testing logical decoding patch[1], observed one hang to TAP test.
# SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN
('r', 's');
# expecting this output:
# t
# last actual query output:
# f
# with stderr:
# Looks like your test exited with 29 before it could output anything.
t/012_stream_subxact_abort.pl .. Dubious, test returned 29 (wstat 7424,
0x1d00)
Failed 2/2 subtests
Test Summary Report
-------------------
t/012_stream_subxact_abort.pl (Wstat: 7424 Tests: 0 Failed: 0)
Non-zero exit status: 29
Parse errors: Bad plan. You planned 2 tests but ran 0.
Files=1, Tests=0, 262 wallclock secs ( 0.01 usr 0.00 sys + 14.79 cusr
12.25 csys = 27.05 CPU)
Result: FAIL
Makefile:21: recipe for target 'check' failed
make: [check] Error 1 (ignored
*Branch: master*
*Steps to reproduce:*
*Step1 : *apply attached patch
*Step2: *configure with "--enable-tap-tests" and do make install
*Step3: *Go to "src/test/subscription" and fire "make check -i"
It looks like a bug.
Please let me know if you need any other details.
*[1]: *
https://www.postgresql.org/message-id/CAFiTN-uQeYHgyia7%2BXPhTDAwe7NBeXzt2cT2N6gBghHXA%3DXT9Q%40mail...
--
Thanks and Regards
Mahendra Singh Thalor
EnterpriseDB: http://www.enterprisedb.com
Attachments:
Patch-for-tap-test-of-012_stream_subxact_abort.patch (application/octet-stream, 3.3K) download
From f1eaa8e79854490254cfbfd9cd86216490acd373 Mon Sep 17 00:00:00 2001
From: Mahendra Singh Thalor <mahi6run@gmail.com>
Date: Wed, 13 May 2020 22:29:37 -0700
Subject: [PATCH] Patch for tap test of 012
This tap test is hanging.
---
.../t/012_stream_subxact_abort.pl | 67 +++++++++++++++++++
1 file changed, 67 insertions(+)
create mode 100644 src/test/subscription/t/012_stream_subxact_abort.pl
diff --git a/src/test/subscription/t/012_stream_subxact_abort.pl b/src/test/subscription/t/012_stream_subxact_abort.pl
new file mode 100644
index 0000000000..86dff641a2
--- /dev/null
+++ b/src/test/subscription/t/012_stream_subxact_abort.pl
@@ -0,0 +1,67 @@
+# Test streaming of large transaction containing multiple subtransactions and rollbacks
+use strict;
+use warnings;
+use PostgresNode;
+use TestLib;
+use Test::More tests => 2;
+
+sub wait_for_caught_up
+{
+ my ($node, $appname) = @_;
+
+ $node->poll_query_until('postgres',
+"SELECT pg_current_wal_lsn() <= replay_lsn FROM pg_stat_replication WHERE application_name = '$appname';"
+ ) or die "Timed out while waiting for subscriber to catch up";
+}
+
+# Create publisher node
+my $node_publisher = get_new_node('publisher');
+$node_publisher->init(allows_streaming => 'logical');
+$node_publisher->append_conf('postgresql.conf', 'logical_decoding_work_mem = 64kB');
+$node_publisher->start;
+
+# Create subscriber node
+my $node_subscriber = get_new_node('subscriber');
+$node_subscriber->init(allows_streaming => 'logical');
+$node_subscriber->start;
+
+# Create some preexisting content on publisher
+$node_publisher->safe_psql('postgres',
+"CREATE TABLE test_tab (a int primary key, b varchar, mess text) PARTITION BY HASH (a);
+create table dept_10 partition of test_tab FOR VALUES WITH (MODULUS 1, REMAINDER 0); ");
+$node_publisher->safe_psql('postgres',
+ "INSERT INTO test_tab VALUES (1, 'foo'), (2, 'bar')");
+
+# Setup structure on subscriber
+$node_subscriber->safe_psql('postgres', "CREATE TABLE test_tab (a int primary key, b text, c INT, d INT, e INT) PARTITION BY HASH (a);
+ create table dept_10 partition of test_tab FOR VALUES WITH (MODULUS 1, REMAINDER 0);");
+
+# Setup logical replication
+my $publisher_connstr = $node_publisher->connstr . ' dbname=postgres';
+$node_publisher->safe_psql('postgres', "CREATE PUBLICATION tap_pub FOR TABLE test_tab");
+
+my $appname = 'tap_sub';
+$node_subscriber->safe_psql('postgres',
+"CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub"
+);
+
+wait_for_caught_up($node_publisher, $appname);
+
+# Also wait for initial table sync to finish
+my $synced_query =
+"SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('r', 's');";
+$node_subscriber->poll_query_until('postgres', $synced_query)
+ or die "Timed out while waiting for subscriber to synchronize data";
+
+my $result =
+ $node_subscriber->safe_psql('postgres', "SELECT count(*), count(c) FROM test_tab");
+is($result, qq(2|0), 'check initial data was copied to subscriber');
+
+wait_for_caught_up($node_publisher, $appname);
+
+$result =
+ $node_subscriber->safe_psql('postgres', "SELECT count(*), count(c) FROM test_tab");
+is($result, qq(1000|0), 'check extra columns contain local defaults');
+
+$node_subscriber->stop;
+$node_publisher->stop;
--
2.17.1
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: attached TAP test is hanging
@ 2020-05-15 09:52 Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
parent: Mahendra Singh Thalor <mahi6run@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: Peter Eisentraut @ 2020-05-15 09:52 UTC (permalink / raw)
To: Mahendra Singh Thalor <mahi6run@gmail.com>; pgsql-bugs@lists.postgresql.org
On 2020-05-15 05:36, Mahendra Singh Thalor wrote:
> While testing logical decoding patch[1], observed one hang to TAP test.
That is a new patch under discussion, not something that is committed
yet. So your feedback will surely be welcome in that thread, but it's
not a bug in PostgreSQL at this time.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-05-15 09:52 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 03:36 attached TAP test is hanging Mahendra Singh Thalor <mahi6run@gmail.com>
2020-05-15 09:52 ` Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox