diff options
author | Pavan Deolasee | 2016-02-17 07:28:31 +0000 |
---|---|---|
committer | Pavan Deolasee | 2016-10-18 09:58:31 +0000 |
commit | c58b0aa0a6ce18dedc14476e80b867e061700368 (patch) | |
tree | 8adaa1538c4603e0f00b2807b238e3dc47ff7d52 /src/include/postgres.h | |
parent | ea0617ab76ff60c979a0adf1d00f391fbe24d126 (diff) |
Handle a race condition between portal close 'C' message and new request for
running the portal, as part of the next step of query execution
A producer will unbind and remove the SharedQ once all consumers are done
with reading pending data. It does not wait for consumers to actually send
close 'C' message. If the next step of the execution now recreates the SharedQ
with the same name (because its the same RemoteSubplan being re-executed), and
if the close messages arrives after that, but before the new producer gets
chance to bind to the SharedQ, we will end up marking future consumers of the
new SharedQ as 'DONE'. The SharedQueueAcquire then incorrectly assumes that
this is a stale Q belonging to earlier execution and gets in an infinite wait.
Also do not try indefinitely for the old producer to unbind and remove a stale
queue. Any further bugs in this area will cause infinite loops. Instead try for
a fixed number of times and then let the query fail.
Diffstat (limited to 'src/include/postgres.h')
0 files changed, 0 insertions, 0 deletions