Re: Parallel worker hangs while handling errors. - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Parallel worker hangs while handling errors.
Date
Msg-id CALj2ACVe+rPYUhxO45LfgYQYzjqERmPyh_uDvHvP4wje-dKWgQ@mail.gmail.com
Whole thread Raw
In response to Parallel worker hangs while handling errors.  (vignesh C <vignesh21@gmail.com>)
List pgsql-hackers
>
> 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

Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Log the location field before any backtrace
Next
From: Bharath Rupireddy
Date:
Subject: Re: [PATCH] Performance Improvement For Copy From Binary Files