|
63 | 63 | $node_publisher->safe_psql('postgres',
|
64 | 64 | "ALTER PUBLICATION tap_pub_ins_only ADD TABLE tab_ins");
|
65 | 65 |
|
66 |
| -my $appname = 'tap_sub'; |
67 | 66 | $node_subscriber->safe_psql('postgres',
|
68 |
| - "CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr application_name=$appname' PUBLICATION tap_pub, tap_pub_ins_only" |
| 67 | + "CREATE SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr' PUBLICATION tap_pub, tap_pub_ins_only" |
69 | 68 | );
|
70 | 69 |
|
71 |
| -$node_publisher->wait_for_catchup($appname); |
| 70 | +$node_publisher->wait_for_catchup('tap_sub'); |
72 | 71 |
|
73 | 72 | # Also wait for initial table sync to finish
|
74 | 73 | my $synced_query =
|
|
103 | 102 | "DELETE FROM tab_include WHERE a > 20");
|
104 | 103 | $node_publisher->safe_psql('postgres', "UPDATE tab_include SET a = -a");
|
105 | 104 |
|
106 |
| -$node_publisher->wait_for_catchup($appname); |
| 105 | +$node_publisher->wait_for_catchup('tap_sub'); |
107 | 106 |
|
108 | 107 | $result = $node_subscriber->safe_psql('postgres',
|
109 | 108 | "SELECT count(*), min(a), max(a) FROM tab_ins");
|
|
146 | 145 | $node_publisher->safe_psql('postgres',
|
147 | 146 | "UPDATE tab_full2 SET x = 'bb' WHERE x = 'b'");
|
148 | 147 |
|
149 |
| -$node_publisher->wait_for_catchup($appname); |
| 148 | +$node_publisher->wait_for_catchup('tap_sub'); |
150 | 149 |
|
151 | 150 | $result = $node_subscriber->safe_psql('postgres',
|
152 | 151 | "SELECT count(*), min(a), max(a) FROM tab_full");
|
|
165 | 164 | # as we need to poll for a change but the test suite will fail none the less
|
166 | 165 | # when something goes wrong.
|
167 | 166 | my $oldpid = $node_publisher->safe_psql('postgres',
|
168 |
| - "SELECT pid FROM pg_stat_replication WHERE application_name = '$appname';" |
| 167 | + "SELECT pid FROM pg_stat_replication WHERE application_name = 'tap_sub';" |
169 | 168 | );
|
170 | 169 | $node_subscriber->safe_psql('postgres',
|
171 |
| - "ALTER SUBSCRIPTION tap_sub CONNECTION 'application_name=$appname $publisher_connstr'" |
| 170 | + "ALTER SUBSCRIPTION tap_sub CONNECTION '$publisher_connstr sslmode=disable'" |
172 | 171 | );
|
173 | 172 | $node_publisher->poll_query_until('postgres',
|
174 |
| - "SELECT pid != $oldpid FROM pg_stat_replication WHERE application_name = '$appname';" |
| 173 | + "SELECT pid != $oldpid FROM pg_stat_replication WHERE application_name = 'tap_sub';" |
175 | 174 | ) or die "Timed out while waiting for apply to restart";
|
176 | 175 |
|
177 | 176 | $oldpid = $node_publisher->safe_psql('postgres',
|
178 |
| - "SELECT pid FROM pg_stat_replication WHERE application_name = '$appname';" |
| 177 | + "SELECT pid FROM pg_stat_replication WHERE application_name = 'tap_sub';" |
179 | 178 | );
|
180 | 179 | $node_subscriber->safe_psql('postgres',
|
181 | 180 | "ALTER SUBSCRIPTION tap_sub SET PUBLICATION tap_pub_ins_only WITH (copy_data = false)"
|
182 | 181 | );
|
183 | 182 | $node_publisher->poll_query_until('postgres',
|
184 |
| - "SELECT pid != $oldpid FROM pg_stat_replication WHERE application_name = '$appname';" |
| 183 | + "SELECT pid != $oldpid FROM pg_stat_replication WHERE application_name = 'tap_sub';" |
185 | 184 | ) or die "Timed out while waiting for apply to restart";
|
186 | 185 |
|
187 | 186 | $node_publisher->safe_psql('postgres',
|
|
193 | 192 | $node_publisher->stop('fast');
|
194 | 193 | $node_publisher->start;
|
195 | 194 |
|
196 |
| -$node_publisher->wait_for_catchup($appname); |
| 195 | +$node_publisher->wait_for_catchup('tap_sub'); |
197 | 196 |
|
198 | 197 | $result = $node_subscriber->safe_psql('postgres',
|
199 | 198 | "SELECT count(*), min(a), max(a) FROM tab_ins");
|
|
216 | 215 | );
|
217 | 216 | $node_publisher->safe_psql('postgres', "INSERT INTO tab_full VALUES(0)");
|
218 | 217 |
|
219 |
| -$node_publisher->wait_for_catchup($appname); |
| 218 | +$node_publisher->wait_for_catchup('tap_sub'); |
220 | 219 |
|
221 | 220 | # note that data are different on provider and subscriber
|
222 | 221 | $result = $node_subscriber->safe_psql('postgres',
|
|
230 | 229 |
|
231 | 230 | # check restart on rename
|
232 | 231 | $oldpid = $node_publisher->safe_psql('postgres',
|
233 |
| - "SELECT pid FROM pg_stat_replication WHERE application_name = '$appname';" |
| 232 | + "SELECT pid FROM pg_stat_replication WHERE application_name = 'tap_sub';" |
234 | 233 | );
|
235 | 234 | $node_subscriber->safe_psql('postgres',
|
236 | 235 | "ALTER SUBSCRIPTION tap_sub RENAME TO tap_sub_renamed");
|
237 | 236 | $node_publisher->poll_query_until('postgres',
|
238 |
| - "SELECT pid != $oldpid FROM pg_stat_replication WHERE application_name = '$appname';" |
| 237 | + "SELECT pid != $oldpid FROM pg_stat_replication WHERE application_name = 'tap_sub_renamed';" |
239 | 238 | ) or die "Timed out while waiting for apply to restart";
|
240 | 239 |
|
241 | 240 | # check all the cleanup
|
|
0 commit comments