Re: Parallel worker hangs while handling errors.
Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: vignesh C <vignesh21@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
Robert Haas <robertmhaas@gmail.com>
Date: 2020-07-09T09:42:57Z
Lists: pgsql-hackers
Attachments
- testcase.txt (text/plain)
> > Parallel worker hangs while handling errors. > > When there is an error in the parallel worker process, we will call > ereport/elog with the error message. Worker will then jump from > errfinish to setjmp in StartBackgroundWorker function which was set > earlier. Then the worker process will then send the error message > through the shared memory to the leader process. Shared memory size is > ok 16K, if the error message is less than 16K it works fine. I reproduced the hang issue with the parallel copy patches[1]. The use case is as follows - one of the parallel workers tries to report error to the leader process and as part of the error context it also tries to send the entire row/tuple data(which is a lot more than 16KB). The fix provided here solves the above problem, i.e. no hang occurs, and the entire tuple/row data in the error from worker to leader gets transferred, see the attachment "testcase.text" for the output. Apart from that, I also executed the regression tests (make check and make check-world) on the patch, no issues are observed. [1] - https://www.postgresql.org/message-id/CALDaNm2-wMYO68vtDuuWO5h4FQCsfm4Pcg5XrzEPtRty1bEM7w%40mail.gmail.com With Regards, Bharath Rupireddy. EnterpriseDB: http://www.enterprisedb.com
Commits
-
Centralize setup of SIGQUIT handling for postmaster child processes.
- 44fc6e259b79 14.0 landed
-
Accept SIGQUIT during error recovery in auxiliary processes.
- 7634bd4f6d38 14.0 landed
-
Avoid lockup of a parallel worker when reporting a long error message.
- be4b0c0077e6 14.0 landed
- 82dd373f2c56 12.5 landed
- 526df0a236df 11.10 landed
- 3738651f5b82 9.5.24 landed
- 2a938c7935cf 10.15 landed
- 2500e51e7bdc 9.6.20 landed
- 17424e79d979 13.0 landed