pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix isolationtester race condition for notices sent before block
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix isolationtester race condition for notices sent before block
@ 2019-07-28 00:22  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2019-07-28 00:22 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix isolationtester race condition for notices sent before blocking.

If a test sends a notice just before blocking, it's possible on
slow machines for isolationtester to detect the blocked state before
it's consumed the notice.  (For this to happen, the notice would have
to arrive after isolationtester has waited for data for 10ms, so on
fast/lightly-loaded machines it's hard to reproduce the failure.)
But, if we have seen the backend as blocked, it's certainly already
sent any notices it's going to send.  Therefore, one more round of
PQconsumeInput and PQisBusy should be enough to collect and process
any such notices.

This appears to explain the instability noted in commit ebd499282, so undo
the hack therein to not print notices from insert-conflict-specconflict.

Patch by me, diagnosis by Andres Freund.

Discussion: https://postgr.es/m/14616.1564251339@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/30717637c1c58fcd02980a6752c7e13c9de12b69

Modified Files
--------------
.../expected/insert-conflict-specconflict.out      | 38 ++++++++++++++++++++++
src/test/isolation/isolationtester.c               | 22 +++++++++++++
.../specs/insert-conflict-specconflict.spec        |  6 ----
3 files changed, 60 insertions(+), 6 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix isolationtester race condition for notices sent before block
@ 2019-09-10 02:54  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2019-09-10 02:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix isolationtester race condition for notices sent before blocking.

If a test sends a notice just before blocking, it's possible on
slow machines for isolationtester to detect the blocked state before
it's consumed the notice.  (For this to happen, the notice would have
to arrive after isolationtester has waited for data for 10ms, so on
fast/lightly-loaded machines it's hard to reproduce the failure.)
But, if we have seen the backend as blocked, it's certainly already
sent any notices it's going to send.  Therefore, one more round of
PQconsumeInput and PQisBusy should be enough to collect and process
any such notices.

Back-patch of 30717637c into v12.  We're still discussing whether
to back-patch this further and/or back-patch some other recent
isolationtester fixes, but this much is provably necessary to
make the test cases added by 27cc7cd2b stable in v12.

Discussion: https://postgr.es/m/14616.1564251339@sss.pgh.pa.us
Discussion: https://postgr.es/m/E1i7IqC-0000Uc-5H@gemulon.postgresql.org

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/97fb88ea4a646343d5f0a8cd65b7e5f598785cb4

Modified Files
--------------
src/test/isolation/isolationtester.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-09-10 02:54 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-07-28 00:22 pgsql: Fix isolationtester race condition for notices sent before block Tom Lane <tgl@sss.pgh.pa.us>
2019-09-10 02:54 pgsql: Fix isolationtester race condition for notices sent before block Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox