On Wed, Aug 7, 2024 at 11:24 PM Xiaoran Wang <fanfuxiaoran@gmail.com> wrote:
>     When I use the 'pqmq' recently, I found some issues, just fix them.
>
>      Allow the param 'dsm_segment *seg' to be NULL in function
>     'pq_redirect_to_shm_mq'. As sometimes the shm_mq is created
>     in shared memory instead of DSM.
Under what circumstances does this happen?
>     Add function 'pq_leave_shm_mq' to allow the process to go
>     back to the previous pq environment.
In the code as it currently exists, a parallel worker never has a
connected client, and it talks to a shm_mq instead. So there's no need
for this. If a backend needs to communicate with both a connected
client and also a shm_mq, it probably should not use pqmq but rather
decide explicitly which messages should be sent to the client and
which to the shm_mq. Otherwise, it seems hard to avoid possible loss
of protocol sync.
--
Robert Haas
EDB: http://www.enterprisedb.com