pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Be more wary about shm_toc_lookup failure.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Be more wary about shm_toc_lookup failure.
@ 2018-02-02 23:32 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2018-02-02 23:32 UTC (permalink / raw)
  To: pgsql-committers

Be more wary about shm_toc_lookup failure.

Commit 445dbd82a basically missed the point of commit d46633506,
which was that we shouldn't allow shm_toc_lookup() failure to lead
to a core dump or assertion crash, because the odds of such a
failure should never be considered negligible.  It's correct that
we can't expect the PARALLEL_KEY_ERROR_QUEUE TOC entry to be there
if we have no workers.  But if we have no workers, we're not going
to do anything in this function with the lookup result anyway,
so let's just skip it.  That lets the code use the easy-to-prove-safe
noError=false case, rather than anything requiring effort to review.

Back-patch to v10, like the previous commit.

Discussion: https://postgr.es/m/3647.1517601675@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/957ff087c822c95f63df956e1a91c15614ecb2b4

Modified Files
--------------
src/backend/access/transam/parallel.c | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Be more wary about shm_toc_lookup failure.
@ 2018-02-02 23:32 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2018-02-02 23:32 UTC (permalink / raw)
  To: pgsql-committers

Be more wary about shm_toc_lookup failure.

Commit 445dbd82a basically missed the point of commit d46633506,
which was that we shouldn't allow shm_toc_lookup() failure to lead
to a core dump or assertion crash, because the odds of such a
failure should never be considered negligible.  It's correct that
we can't expect the PARALLEL_KEY_ERROR_QUEUE TOC entry to be there
if we have no workers.  But if we have no workers, we're not going
to do anything in this function with the lookup result anyway,
so let's just skip it.  That lets the code use the easy-to-prove-safe
noError=false case, rather than anything requiring effort to review.

Back-patch to v10, like the previous commit.

Discussion: https://postgr.es/m/3647.1517601675@sss.pgh.pa.us

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/34653bc9833d9c95ed1c52bed1ff01c6193de17b

Modified Files
--------------
src/backend/access/transam/parallel.c | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2018-02-02 23:32 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-02-02 23:32 pgsql: Be more wary about shm_toc_lookup failure. Tom Lane <tgl@sss.pgh.pa.us>
2018-02-02 23:32 pgsql: Be more wary about shm_toc_lookup failure. Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox