Hi,

This is a fork thread for [1]. This patch aims to reduce codes related with
parallel apply.

Background
==========
So far, the error response from parallel apply workers is redirected to a shared
message queue, the leader worker recognizes their exit based on the response 
code.
It was needed because before 952bab8, leader appended the actual error message
from the parallel workers to the error context.

952bab8 simplified the error reporting style during the parallel apply, the
leader worker does not read error messages from parallel apply workers anymore.
But a shared message queue between the leader and worker is still retained.

Proposal
=======
I propose to introduce an indicator for parallel apply workers on the shared 
memory.
Parallel apply worker sets the status to FAILED at exit, and leader exits too 
based
on the change. Instead, the error propagation mechanism between workers can be
dropped. Detailed steps.

0. Assuming that parallel apply worker detects an ERROR
1. The parallel worker set their status to FAILED then send SIGUSR1 to the 
leader,
   in before_shmem_exit callback
2. The leader accepts the signal and check status of launched parallel workers.
3. The leader exits too if one of parallel workers exit.

How do you feel?

[1]: 
https://www.postgresql.org/message-id/flat/CALDaNm0SSCS5EJ_KNXau_3iCr_KrpKth=ZrTeOf1DCFbE=3=9...@mail.gmail.com

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Attachment: 0001-Simplify-parallel-apply-worker-error-reporting.patch
Description: 0001-Simplify-parallel-apply-worker-error-reporting.patch

Reply via email to