summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAmit Kapila2025-03-28 05:33:05 +0000
committerAmit Kapila2025-03-28 05:33:05 +0000
commit474d7a1fd858d5ee138cf4504dcd93a9a3123a7d (patch)
tree51eb313b24ce5ee4a035ea01fe1fa1b43644c915 /src
parent058b5152f02ef86c98a795c14dbd6a8e195f4fd1 (diff)
Stablize tests added in 3abe9dc188.
The problem is that after the ALTER SUBSCRIPTION tap_sub SET PUBLICATION command, we didn't wait for the new walsender to start on the publisher. Immediately after ALTER, we performed Insert and expected it to replicate. However, the replication could start from a point after the INSERT location, and as the subscription isn't copying initial data, we could miss such an Insert. The fix is to wait for connection to be established between publisher and subscriber before starting DML operations that are expected to replicate. As per CI. Reported-by: Andres Freund <[email protected]> Author: Hayato Kuroda <[email protected]> Discussion: https://postgr.es/m/CALDaNm2ms1deM5EYNLFEfESv_Kw=Y4AiTB0LP=qGS-UpFwGbPg@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r--src/test/subscription/t/007_ddl.pl6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/test/subscription/t/007_ddl.pl b/src/test/subscription/t/007_ddl.pl
index 7d4c2d51c3a..de846193bb5 100644
--- a/src/test/subscription/t/007_ddl.pl
+++ b/src/test/subscription/t/007_ddl.pl
@@ -130,16 +130,18 @@ $node_publisher->safe_psql('postgres', qq[
CREATE PUBLICATION pub_for_all_tables FOR ALL TABLES;
]);
$node_subscriber->safe_psql('postgres',
- "CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr' PUBLICATION pub_for_tab WITH (copy_data = off)"
+ "CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr' PUBLICATION pub_for_tab"
);
+$node_subscriber->wait_for_subscription_sync($node_publisher, 'tap_sub');
# Confirms RENAME command works well for a publication
test_swap('test1', 'pub_for_tab', 'tap_sub');
# Switches a publication which includes all tables
$node_subscriber->safe_psql('postgres',
- "ALTER SUBSCRIPTION tap_sub SET PUBLICATION pub_for_all_tables WITH (refresh = true, copy_data = false);"
+ "ALTER SUBSCRIPTION tap_sub SET PUBLICATION pub_for_all_tables;"
);
+$node_subscriber->wait_for_subscription_sync($node_publisher, 'tap_sub');
# Confirms RENAME command works well for ALL TABLES publication
test_swap('test2', 'pub_for_all_tables', 'tap_sub');