diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2020-09-03 16:52:09 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2020-09-03 16:52:09 -0400 |
commit | 82dd373f2c56f7b32a3304260195fdaf6ed7cd9c (patch) | |
tree | 8f0b9e13a95ecc96ae3e7265484d3ec5b2972193 /src/test/regress/sql/select_parallel.sql | |
parent | fcc42756818cef68e61e35e6d71cac6a73e24bb9 (diff) |
Avoid lockup of a parallel worker when reporting a long error message.
Because sigsetjmp() will restore the initial state with signals blocked,
the code path in bgworker.c for reporting an error and exiting would
execute that way. Usually this is fairly harmless; but if a parallel
worker had an error message exceeding the shared-memory communication
buffer size (16K) it would lock up, because it would wait for a
resume-sending signal from its parallel leader which it would never
detect.
To fix, just unblock signals at the appropriate point.
This can be shown to fail back to 9.6. The lack of parallel query
infrastructure makes it difficult to provide a simple test case for
9.5; but I'm pretty sure the issue exists in some form there as well,
so apply the code change there too.
Vignesh C, reviewed by Bharath Rupireddy, Robert Haas, and myself
Discussion: https://postgr.es/m/CALDaNm1d1hHPZUg3xU4XjtWBOLCrA+-2cJcLpw-cePZ=GgDVfA@mail.gmail.com
Diffstat (limited to 'src/test/regress/sql/select_parallel.sql')
-rw-r--r-- | src/test/regress/sql/select_parallel.sql | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/test/regress/sql/select_parallel.sql b/src/test/regress/sql/select_parallel.sql index 11e77355332..5a01a98b268 100644 --- a/src/test/regress/sql/select_parallel.sql +++ b/src/test/regress/sql/select_parallel.sql @@ -400,9 +400,10 @@ EXPLAIN (analyze, timing off, summary off, costs off) SELECT * FROM tenk1; ROLLBACK TO SAVEPOINT settings; -- provoke error in worker +-- (make the error message long enough to require multiple bufferloads) SAVEPOINT settings; SET LOCAL force_parallel_mode = 1; -select stringu1::int2 from tenk1 where unique1 = 1; +select (stringu1 || repeat('abcd', 5000))::int2 from tenk1 where unique1 = 1; ROLLBACK TO SAVEPOINT settings; -- test interaction with set-returning functions |