Re: force parallel mode vs CTAS

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, tcook(at)blackducksoftware(dot)com, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>
Subject: Re: force parallel mode vs CTAS
Date: 2017-12-21 15:34:31
Message-ID: 15333.1513870471@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> Great subject line!

fixed ...

> If I run the regression tests with force_parallel_mode=on prior to the
> parallel hash join patch, they pass. If I run them now, they fail
> inside the parallel hash join tests here:
> create table wide as select generate_series(1, 2) as id, rpad('',
> 320000, 'x') as t;
> I'm guessing that test case would have failed before, too, but we
> didn't have it. I'll analyze this further in a bit.

I've not updated my repo to today's sources yet. But on yesterday's
HEAD:

regression=# create table wide as select generate_series(1, 2) as id, rpad('',
regression(# 320000, 'x') as t;
SELECT 2
regression=# drop table wide;
DROP TABLE
regression=# set force_parallel_mode=on;
SET
regression=# create table wide as select generate_series(1, 2) as id, rpad('',
320000, 'x') as t;
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.

So yes, this is a pre-existing bug accidentally exposed by the PHJ
tests. Log says

TRAP: FailedAssertion("!(CurrentTransactionState->parallelModeLevel == 0)", File: "/home/postgres/pgsql/src/backend/access/transam/xact.c", Line: 691)
2017-12-21 10:30:23.131 EST [4958] LOG: server process (PID 14939) was terminated by signal 6: Aborted
2017-12-21 10:30:23.131 EST [4958] DETAIL: Failed process was running: create table wide as select generate_series(1, 2) as id, rpad('',
320000, 'x') as t;

and here's the stack trace:

#0 0x0000003b78a32495 in raise (sig=6)
at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x0000003b78a33c75 in abort () at abort.c:92
#2 0x000000000087183d in ExceptionalCondition (
conditionName=<value optimized out>, errorType=<value optimized out>,
fileName=<value optimized out>, lineNumber=<value optimized out>)
at /home/postgres/pgsql/src/backend/utils/error/assert.c:54
#3 0x00000000005070d4 in GetCurrentCommandId (used=<value optimized out>)
at /home/postgres/pgsql/src/backend/access/transam/xact.c:691
#4 0x00000000004ccf18 in toast_save_datum (rel=0x7ff973c47938,
value=19547872, oldexternal=0x0, options=2)
at /home/postgres/pgsql/src/backend/access/heap/tuptoaster.c:1477
#5 0x00000000004cf7cd in toast_insert_or_update (rel=<value optimized out>,
newtup=0x1256460, oldtup=0x7d8, options=2)
at /home/postgres/pgsql/src/backend/access/heap/tuptoaster.c:814
#6 0x00000000004c320e in heap_insert (relation=0x7ff973c47938, tup=0x1256460,
cid=5, options=2, bistate=0x1125f70)
at /home/postgres/pgsql/src/backend/access/heap/heapam.c:2429
#7 0x00000000005b3243 in intorel_receive (slot=<value optimized out>,
self=0x1065470) at /home/postgres/pgsql/src/backend/commands/createas.c:599
#8 0x00000000006249cc in ExecutePlan (queryDesc=0x10f7040,
direction=<value optimized out>, count=0, execute_once=48 '0')
at /home/postgres/pgsql/src/backend/executor/execMain.c:1753
#9 standard_ExecutorRun (queryDesc=0x10f7040,
direction=<value optimized out>, count=0, execute_once=48 '0')
at /home/postgres/pgsql/src/backend/executor/execMain.c:361
#10 0x00000000005b3511 in ExecCreateTableAs (stmt=<value optimized out>,
queryString=0x103ff18 "create table wide as select generate_series(1, 2) as id, rpad('',\n320000, 'x') as t;", params=0x0, queryEnv=<value optimized out>,
completionTag=0x7ffddedc4d80 "")
at /home/postgres/pgsql/src/backend/commands/createas.c:351
#11 0x0000000000771f69 in ProcessUtilitySlow (pstate=0x1065358,
pstmt=0x1041d40,
queryString=0x103ff18 "create table wide as select generate_series(1, 2) as id, rpad('',\n320000, 'x') as t;", context=PROCESS_UTILITY_TOPLEVEL,
params=0x0, queryEnv=0x0, dest=0x10f2498, completionTag=0x7ffddedc4d80 "")
at /home/postgres/pgsql/src/backend/tcop/utility.c:1454
#12 0x0000000000772c17 in standard_ProcessUtility (pstmt=0x1041d40,
queryString=0x103ff18 "create table wide as select generate_series(1, 2) as id, rpad('',\n320000, 'x') as t;", context=PROCESS_UTILITY_TOPLEVEL,
params=0x0, queryEnv=0x0, dest=0x10f2498, completionTag=0x7ffddedc4d80 "")
at /home/postgres/pgsql/src/backend/tcop/utility.c:932
#13 0x000000000076ecab in PortalRunUtility (portal=0x10a2f08, pstmt=0x1041d40,
isTopLevel=<value optimized out>, setHoldSnapshot=<value optimized out>,
dest=0x10f2498, completionTag=<value optimized out>)
at /home/postgres/pgsql/src/backend/tcop/pquery.c:1178

regards, tom lane

In response to

  • Re: ddd at 2017-12-21 15:18:05 from Robert Haas

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-12-21 15:35:06 Re: ddd
Previous Message Fabien COELHO 2017-12-21 15:26:04 Re: General purpose hashing func in pgbench