Parallel CREATE INDEX vs DSM starvation

Started by Thomas Munroover 6 years ago3 messageshackers
Jump to latest
#1Thomas Munro
thomas.munro@gmail.com

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]/messages/by-id/CA+hUKG+cfjHy63hXEOc-CRZEPcUhu9=P3gKk_W9OiXzj-dfV_g@mail.gmail.com.

[1]: /messages/by-id/CA+hUKG+cfjHy63hXEOc-CRZEPcUhu9=P3gKk_W9OiXzj-dfV_g@mail.gmail.com

Attachments:

0001-Handle-lack-of-DSM-segment-slots-in-parallel-btree-b.patchapplication/octet-stream; name=0001-Handle-lack-of-DSM-segment-slots-in-parallel-btree-b.patchDownload+9-1
In reply to: Thomas Munro (#1)
Re: Parallel CREATE INDEX vs DSM starvation

On Wed, Jan 29, 2020 at 11:38 PM Thomas Munro <thomas.munro@gmail.com> wrote:

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.

I guess we can't call _bt_end_parallel() here. So your patch LGTM.

Thanks
--
Peter Geoghegan

#3Thomas Munro
thomas.munro@gmail.com
In reply to: Peter Geoghegan (#2)
Re: Parallel CREATE INDEX vs DSM starvation

On Thu, Jan 30, 2020 at 8:47 PM Peter Geoghegan <pg@bowt.ie> wrote:

On Wed, Jan 29, 2020 at 11:38 PM Thomas Munro <thomas.munro@gmail.com> wrote:

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.

I guess we can't call _bt_end_parallel() here. So your patch LGTM.

Thanks. Pushed.