pgsql: Fix isolationtester race condition for notices sent beforeblock

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix isolationtester race condition for notices sent beforeblock
Дата
Msg-id E1hrWx3-0002E6-Se@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Don't drop NOTICE messages in isolation tests.
Следующее
От: Michael Paquier
Дата:
Сообщение: pgsql: Fix typo in fd.c