Parallel CREATE INDEX vs DSM starvation

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Peter Geoghegan <pg@bowt.ie>
Date: 2020-01-30T07:37:55Z
Lists: pgsql-hackers

Attachments

Hello,

CreateParallelContext() can return a context with seg == NULL.  That
causes CREATE INDEX to segfault.  Instead, it should fall back to
non-parallel build.  See attached.

This probably explains a segfault reported over on pgsql-general[1].

[1] https://www.postgresql.org/message-id/CA%2BhUKG%2BcfjHy63hXEOc-CRZEPcUhu9%3DP3gKk_W9OiXzj-dfV_g%40mail.gmail.com

Commits

  1. Handle lack of DSM slots in parallel btree build.