|
47 | 47 | "CREATE TABLE tab_int AS SELECT generate_series(1,1002) AS a");
|
48 | 48 |
|
49 | 49 | # Wait for standbys to catch up
|
50 |
| -$node_primary->wait_for_catchup($node_standby_1,'replay', |
51 |
| -$node_primary->lsn('insert')); |
52 |
| -$node_standby_1->wait_for_catchup($node_standby_2,'replay', |
53 |
| -$node_standby_1->lsn('replay')); |
| 50 | +my$primary_lsn =$node_primary->lsn('write'); |
| 51 | +$node_primary->wait_for_catchup($node_standby_1,'replay',$primary_lsn); |
| 52 | +$node_standby_1->wait_for_catchup($node_standby_2,'replay',$primary_lsn); |
54 | 53 |
|
55 | 54 | my$result =
|
56 | 55 | $node_standby_1->safe_psql('postgres',"SELECT count(*) FROM tab_int");
|
|
67 | 66 | "CREATE SEQUENCE seq1; SELECT nextval('seq1')");
|
68 | 67 |
|
69 | 68 | # Wait for standbys to catch up
|
70 |
| -$node_primary->wait_for_catchup($node_standby_1,'replay', |
71 |
| -$node_primary->lsn('insert')); |
72 |
| -$node_standby_1->wait_for_catchup($node_standby_2,'replay', |
73 |
| -$node_standby_1->lsn('replay')); |
| 69 | +$primary_lsn =$node_primary->lsn('write'); |
| 70 | +$node_primary->wait_for_catchup($node_standby_1,'replay',$primary_lsn); |
| 71 | +$node_standby_1->wait_for_catchup($node_standby_2,'replay',$primary_lsn); |
74 | 72 |
|
75 | 73 | $result =$node_standby_1->safe_psql('postgres',"SELECT * FROM seq1");
|
76 | 74 | print"standby 1:$result\n";
|
@@ -374,10 +372,10 @@ sub replay_check
|
374 | 372 | my$newval =$node_primary->safe_psql('postgres',
|
375 | 373 | 'INSERT INTO replayed(val) SELECT coalesce(max(val),0) + 1 AS newval FROM replayed RETURNING val'
|
376 | 374 | );
|
377 |
| -$node_primary->wait_for_catchup($node_standby_1,'replay', |
378 |
| -$node_primary->lsn('insert')); |
379 |
| -$node_standby_1->wait_for_catchup($node_standby_2,'replay', |
380 |
| -$node_standby_1->lsn('replay')); |
| 375 | +my$primary_lsn =$node_primary->lsn('write'); |
| 376 | +$node_primary->wait_for_catchup($node_standby_1,'replay',$primary_lsn); |
| 377 | +$node_standby_1->wait_for_catchup($node_standby_2,'replay',$primary_lsn); |
| 378 | + |
381 | 379 | $node_standby_1->safe_psql('postgres',
|
382 | 380 | qq[SELECT 1 FROM replayed WHERE val =$newval])
|
383 | 381 | ordie"standby_1 didn't replay primary value$newval";
|
@@ -481,8 +479,7 @@ sub replay_check
|
481 | 479 | my$newval =$node_primary->safe_psql('postgres',
|
482 | 480 | 'INSERT INTO replayed(val) SELECT coalesce(max(val),0) + 1 AS newval FROM replayed RETURNING val'
|
483 | 481 | );
|
484 |
| -$node_primary->wait_for_catchup($node_standby_2,'replay', |
485 |
| -$node_primary->lsn('insert')); |
| 482 | +$node_primary->wait_for_catchup($node_standby_2); |
486 | 483 | my$is_replayed =$node_standby_2->safe_psql('postgres',
|
487 | 484 | qq[SELECT 1 FROM replayed WHERE val =$newval]);
|
488 | 485 | is($is_replayed,qq(1),"standby_2 didn't replay primary value$newval");
|
|