Re: Repeated crashes in GENERATED ... AS IDENTITY tests

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Repeated crashes in GENERATED ... AS IDENTITY tests
Date: 2018-04-19 20:49:46
Message-ID: 20180419204946.5ujino6w4dy7biuc@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:

> The test case that's failing, in identity.sql, has been there since
> early February; the lack of any crashes till more recently suggests
> that something committed in mid-to-late March broke it.
> I have no idea what's going on there, but I think this is clearly
> something we need to consider an open item for PG11. I'll put it
> on the list.


Of the machines you listed, conchuela has gdb installed, which gives us
a nice backtrace of the crash, pasted below, which seems to blame event
triggers. Of the tests in the same parallel group as identity, the test
fast_default seems to be the only one with an event trigger and was
added on March 28th by 16828d5c0273. That combination seems to explain
why the crashes appeared late ...

I can't look further into this now -- maybe next week if nobody has
beaten me into it. My guess is that the identity stuff is not setting
state like event triggers expect.

================== stack trace: ==================
[New <main task>]
Core was generated by `postgres'.
Program terminated with signal 11, Segmentation fault.
#0 EventTriggerTableRewrite (parsetree=parsetree(at)entry=0x80a852670, tableOid=49861, reason=2) at event_trigger.c:974
974 currentEventTriggerState->table_rewrite_oid = tableOid;
#0 EventTriggerTableRewrite (parsetree=parsetree(at)entry=0x80a852670, tableOid=49861, reason=2) at event_trigger.c:974
#1 0x0000000000601bfc in ATRewriteTables (lockmode=8, wqueue=0x7fffffffe3d8, parsetree=0x80a852670) at tablecmds.c:4326
#2 ATController (parsetree=parsetree(at)entry=0x80a852670, rel=<optimized out>, cmds=<optimized out>, recurse=<optimized out>, lockmode=lockmode(at)entry=8) at tablecmds.c:3536
#3 0x00000000006021af in AlterTable (relid=relid(at)entry=49861, lockmode=lockmode(at)entry=8, stmt=stmt(at)entry=0x80a852670) at tablecmds.c:3206
#4 0x000000000077df9f in ProcessUtilitySlow (pstate=pstate(at)entry=0x80a852118, pstmt=pstmt(at)entry=0x801647110, queryString=queryString(at)entry=0x801646118 "ALTER TABLE itest13 ADD COLUMN b int GENERATED BY DEFAULT AS IDENTITY;", context=context(at)entry=PROCESS_UTILITY_TOPLEVEL, params=params(at)entry=0x0, queryEnv=queryEnv(at)entry=0x0, completionTag=0x7fffffffe830 "", dest=0x801647400) at utility.c:1116
#5 0x000000000077c632 in standard_ProcessUtility (pstmt=0x801647110, queryString=0x801646118 "ALTER TABLE itest13 ADD COLUMN b int GENERATED BY DEFAULT AS IDENTITY;", context=PROCESS_UTILITY_TOPLEVEL, params=0x0, queryEnv=0x0, dest=0x801647400, completionTag=0x7fffffffe830 "") at utility.c:919
#6 0x0000000000779e05 in PortalRunUtility (portal=0x80a60c118, pstmt=0x801647110, isTopLevel=<optimized out>, setHoldSnapshot=<optimized out>, dest=0x801647400, completionTag=0x7fffffffe830 "") at pquery.c:1183
#7 0x000000000077a925 in PortalRunMulti (portal=portal(at)entry=0x80a60c118, isTopLevel=isTopLevel(at)entry=true, setHoldSnapshot=setHoldSnapshot(at)entry=false, dest=dest(at)entry=0x801647400, altdest=altdest(at)entry=0x801647400, completionTag=completionTag(at)entry=0x7fffffffe830 "") at pquery.c:1336
#8 0x000000000077b5be in PortalRun (portal=portal(at)entry=0x80a60c118, count=count(at)entry=9223372036854775807, isTopLevel=isTopLevel(at)entry=true, run_once=run_once(at)entry=true, dest=dest(at)entry=0x801647400, altdest=altdest(at)entry=0x801647400, completionTag=0x7fffffffe830 "") at pquery.c:804
#9 0x00000000007771e5 in exec_simple_query (query_string=0x801646118 "ALTER TABLE itest13 ADD COLUMN b int GENERATED BY DEFAULT AS IDENTITY;") at postgres.c:1121
#10 0x000000000077869b in PostgresMain (argc=<optimized out>, argv=argv(at)entry=0x8012f03e8, dbname=0x8012f0190 "regression", username=<optimized out>) at postgres.c:4149
#11 0x0000000000480398 in BackendRun (port=0x8016c0280) at postmaster.c:4409
#12 BackendStartup (port=0x8016c0280) at postmaster.c:4081
#13 ServerLoop () at postmaster.c:1754
#14 0x0000000000701009 in PostmasterMain (argc=argc(at)entry=8, argv=argv(at)entry=0x7ffffffff5d0) at postmaster.c:1362
#15 0x0000000000481978 in main (argc=8, argv=0x7ffffffff5d0) at main.c:228

Álvaro Herrera
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-04-19 20:59:21 Re: Built-in connection pooling
Previous Message Alvaro Herrera 2018-04-19 20:38:02 Re: reloption to prevent VACUUM from truncating empty pages at the end of relation