diff options
author | Michael Paquier <michael@paquier.xyz> | 2019-03-14 12:41:45 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2019-03-14 12:41:45 +0900 |
commit | 364298be22090769da14aa749fe730cf16ed3c2c (patch) | |
tree | 8a447cbe522f19189d2b48f28f37cedccba5f36a /src | |
parent | c015f853bf5958dd7562a17952df33a9d115e65f (diff) | |
download | postgresql-364298be22090769da14aa749fe730cf16ed3c2c.tar.gz postgresql-364298be22090769da14aa749fe730cf16ed3c2c.zip |
Fix race condition in recently-added TAP test for recovery consistency
A couple of queries are run on the primary to create and fill in a test
table, which gets checked on the standby afterwards. However the test
was not waiting for the confirmation that the necessary records have
been replayed on the standby, leading to spurious failures.
Per buildfarm member loach. Thanks to Thomas Munro for the report and
Tom Lane for the failure analysis.
Discussion: https://postgr.es/m/CA+hUKGLUpqG52xtriUz5RpmeKPoEfNxNc-CginG+Cx+X2-Ycew@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r-- | src/test/recovery/t/016_min_consistency.pl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/recovery/t/016_min_consistency.pl b/src/test/recovery/t/016_min_consistency.pl index 8f1a89c2d3e..454f77f619b 100644 --- a/src/test/recovery/t/016_min_consistency.pl +++ b/src/test/recovery/t/016_min_consistency.pl @@ -97,6 +97,10 @@ INSERT INTO test1 SELECT generate_series(1, 10000);"); $primary->safe_psql('postgres', 'CHECKPOINT;'); $primary->safe_psql('postgres', 'UPDATE test1 SET a = a + 1;'); +# Wait for last record to have been replayed on the standby. +$primary->wait_for_catchup($standby, 'replay', + $primary->lsn('insert')); + # Fill in the standby's shared buffers with the data filled in # previously. $standby->safe_psql('postgres', 'SELECT count(*) FROM test1;'); |