9.6.3 - Backend Crash - Parallel Worker Prepared Statements

From: Jarred Ward <jarred(at)simple(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: 9.6.3 - Backend Crash - Parallel Worker Prepared Statements
Date: 2017-08-08 21:56:53
Message-ID: 6F61E6D2-2F5E-4794-9479-A429BE1CEA4B@simple.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

We are experiencing a crash with parallel worker processes enabled in
one of our production 9.6.3 databases on Linux. When parallel workers
are disable, the issue does not occur.

Here is a full repro of the issue on 9.6.3 (tested on macOS 10.12.5
below):

jward(at)slip:~ $ grep '^max_.*worker' /usr/local/var/postgres/postgresql.conf
max_worker_processes = 8
max_parallel_workers_per_gather = 8
jward(at)slip:~ $ createdb repro
jward(at)slip:~ $ psql repro
psql (9.6.3)
Type "help" for help.

repro=# create extension if not exists "uuid-ossp";
CREATE EXTENSION
repro=# create table foo (bar uuid primary key, baz uuid not null, qux uuid not null);
CREATE TABLE
repro=# insert into foo select uuid_generate_v4(), uuid_generate_v4(), uuid_generate_v4() from generate_series(1, 250000);
INSERT 0 250000
repro=# explain select * from foo where baz = uuid_generate_v4() or qux = uuid_generate_v4();
QUERY PLAN
----------------------------------------------------------------------------
Gather (cost=1000.00..6528.27 rows=2494 width=48)
Workers Planned: 1
-> Parallel Seq Scan on foo (cost=0.00..5278.87 rows=1467 width=48)
Filter: ((baz = uuid_generate_v4()) OR (qux = uuid_generate_v4()))
(4 rows)

repro=# prepare test_select_jward (uuid, uuid) as select * from foo where baz = $1 or qux = $2;
PREPARE
repro=# execute test_select_jward ('1c5356b1-ba77-475e-9e16-60be44ab8f70', '0103d5e1-1ae1-3100-9fcd-8adc6f3e43d6');
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
!>

Please let me know if there is any further information I can provide.

Thank you,
Jarred Ward

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2017-08-08 22:12:35 Re: your mail
Previous Message Andres Freund 2017-08-08 21:19:41 Re: your mail