|
63 | 63 | INSERT INTO $table1 SELECT i % 3, 0 FROM generate_series(1,20) i;
|
64 | 64 | CREATE TABLE ${table2}(a int, b int);
|
65 | 65 | ]);
|
66 |
| -my $primary_lsn = $node_primary->lsn('flush'); |
67 |
| -$node_primary->wait_for_catchup($node_standby, 'replay', $primary_lsn); |
| 66 | +$node_primary->wait_for_replay_catchup($node_standby); |
68 | 67 |
|
69 | 68 |
|
70 | 69 | # a longrunning psql that we can use to trigger conflicts
|
|
97 | 96 | BEGIN; LOCK $table1; COMMIT;
|
98 | 97 | ]);
|
99 | 98 |
|
100 |
| -$primary_lsn = $node_primary->lsn('flush'); |
101 |
| -$node_primary->wait_for_catchup($node_standby, 'replay', $primary_lsn); |
| 99 | +$node_primary->wait_for_replay_catchup($node_standby); |
102 | 100 |
|
103 | 101 | my $cursor1 = "test_recovery_conflict_cursor";
|
104 | 102 |
|
|
124 | 122 | # finished, so waiting for catchup ensures that there is no race between
|
125 | 123 | # encountering the recovery conflict which causes the disconnect and checking
|
126 | 124 | # the logfile for the terminated connection.
|
127 |
| -$primary_lsn = $node_primary->lsn('flush'); |
128 |
| -$node_primary->wait_for_catchup($node_standby, 'replay', $primary_lsn); |
| 125 | +$node_primary->wait_for_replay_catchup($node_standby); |
129 | 126 |
|
130 | 127 | check_conflict_log("User was holding shared buffer pin for too long");
|
131 | 128 | reconnect_and_clear();
|
|
138 | 135 |
|
139 | 136 | $node_primary->safe_psql($test_db,
|
140 | 137 | qq[INSERT INTO $table1 SELECT i, 0 FROM generate_series(1,20) i]);
|
141 |
| -$primary_lsn = $node_primary->lsn('flush'); |
142 |
| -$node_primary->wait_for_catchup($node_standby, 'replay', $primary_lsn); |
| 138 | +$node_primary->wait_for_replay_catchup($node_standby); |
143 | 139 |
|
144 | 140 | # DECLARE and FETCH from cursor on the standby
|
145 | 141 | $psql_standby{stdin} .= qq[
|
|
160 | 156 | $node_primary->safe_psql($test_db, qq[VACUUM $table1;]);
|
161 | 157 |
|
162 | 158 | # Wait for attempted replay of PRUNE records
|
163 |
| -$primary_lsn = $node_primary->lsn('flush'); |
164 |
| -$node_primary->wait_for_catchup($node_standby, 'replay', $primary_lsn); |
| 159 | +$node_primary->wait_for_replay_catchup($node_standby); |
165 | 160 |
|
166 | 161 | check_conflict_log(
|
167 | 162 | "User query might have needed to see row versions that must be removed");
|
|
184 | 179 | # DROP TABLE containing block which standby has in a pinned buffer
|
185 | 180 | $node_primary->safe_psql($test_db, qq[DROP TABLE $table1;]);
|
186 | 181 |
|
187 |
| -$primary_lsn = $node_primary->lsn('flush'); |
188 |
| -$node_primary->wait_for_catchup($node_standby, 'replay', $primary_lsn); |
| 182 | +$node_primary->wait_for_replay_catchup($node_standby); |
189 | 183 |
|
190 | 184 | check_conflict_log("User was holding a relation lock for too long");
|
191 | 185 | reconnect_and_clear();
|
|
213 | 207 | # standby
|
214 | 208 | $node_primary->safe_psql($test_db, qq[DROP TABLESPACE $tablespace1;]);
|
215 | 209 |
|
216 |
| -$primary_lsn = $node_primary->lsn('flush'); |
217 |
| -$node_primary->wait_for_catchup($node_standby, 'replay', $primary_lsn); |
| 210 | +$node_primary->wait_for_replay_catchup($node_standby); |
218 | 211 |
|
219 | 212 | check_conflict_log(
|
220 | 213 | "User was or might have been using tablespace that must be dropped");
|
|
255 | 248 | SELECT txid_current();
|
256 | 249 | ]);
|
257 | 250 |
|
258 |
| -$primary_lsn = $node_primary->lsn('flush'); |
259 |
| -$node_primary->wait_for_catchup($node_standby, 'replay', $primary_lsn); |
| 251 | +$node_primary->wait_for_replay_catchup($node_standby); |
260 | 252 |
|
261 | 253 | $psql_standby{stdin} .= qq[
|
262 | 254 | BEGIN;
|
|
282 | 274 | # VACUUM will prune away rows, causing a buffer pin conflict, while standby
|
283 | 275 | # psql is waiting on lock
|
284 | 276 | $node_primary->safe_psql($test_db, qq[VACUUM $table1;]);
|
285 |
| -$primary_lsn = $node_primary->lsn('flush'); |
286 |
| -$node_primary->wait_for_catchup($node_standby, 'replay', $primary_lsn); |
| 277 | +$node_primary->wait_for_replay_catchup($node_standby); |
287 | 278 |
|
288 | 279 | check_conflict_log("User transaction caused buffer deadlock with recovery.");
|
289 | 280 | reconnect_and_clear();
|
|
311 | 302 |
|
312 | 303 | $node_primary->safe_psql('postgres', qq[DROP DATABASE $test_db;]);
|
313 | 304 |
|
314 |
| -$primary_lsn = $node_primary->lsn('flush'); |
315 |
| -$node_primary->wait_for_catchup($node_standby, 'replay', $primary_lsn); |
| 305 | +$node_primary->wait_for_replay_catchup($node_standby); |
316 | 306 |
|
317 | 307 | check_conflict_log("User was connected to a database that must be dropped");
|
318 | 308 |
|
|
0 commit comments