REL_12_STABLE crashing with assertion failure in ExtractReplicaIdentity
От | Hadi Moshayedi |
---|---|
Тема | REL_12_STABLE crashing with assertion failure in ExtractReplicaIdentity |
Дата | |
Msg-id | CAK=1=Wrek44Ese1V7LjKiQS-Nd-5LgLi_5_CskGbpggKEf3tKQ@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: REL_12_STABLE crashing with assertion failure inExtractReplicaIdentity
(Andres Freund <andres@anarazel.de>)
|
Список | pgsql-hackers |
It seems that sometimes when DELETE cascades to referencing tables we fail to acquire locks on replica identity index.
To reproduce, set wal_level to logical, and run 1.sql.
I can look into this, but I thought first I should send it here in case someone who is more familiar with these related functions can solve it quickly.
I get the following backtrace:
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007f301154b801 in __GI_abort () at abort.c:79
#2 0x000055df8858a923 in ExceptionalCondition (
conditionName=conditionName@entry=0x55df885fd138 "!(CheckRelationLockedByMe(idx_rel, 1, 1))", errorType=errorType@entry=0x55df885de8fd "FailedAssertion",
fileName=fileName@entry=0x55df885fca32 "heapam.c", lineNumber=lineNumber@entry=7646)
at assert.c:54
#3 0x000055df88165e53 in ExtractReplicaIdentity (relation=relation@entry=0x7f3012b54db0,
tp=tp@entry=0x7ffcf47d53f0, key_changed=key_changed@entry=true,
copy=copy@entry=0x7ffcf47d53d3) at heapam.c:7646
#4 0x000055df8816c22b in heap_delete (relation=0x7f3012b54db0, tid=<optimized out>,
cid=<optimized out>, crosscheck=0x0, wait=true, tmfd=0x7ffcf47d54b0, changingPart=false)
at heapam.c:2676
#5 0x000055df88318b62 in table_tuple_delete (changingPart=false, tmfd=0x7ffcf47d54b0,
wait=true, crosscheck=<optimized out>, snapshot=<optimized out>, cid=<optimized out>,
tid=0x7ffcf47d558a, rel=0x7f3012b54db0) at ../../../src/include/access/tableam.h:1216
#6 ExecDelete (mtstate=mtstate@entry=0x55df8a8196a0, tupleid=0x7ffcf47d558a, oldtuple=0x0,
planSlot=planSlot@entry=0x55df8a81a8e8, epqstate=epqstate@entry=0x55df8a819798,
estate=estate@entry=0x55df8a819058, processReturning=true, canSetTag=true,
changingPart=false, tupleDeleted=0x0, epqreturnslot=0x0) at nodeModifyTable.c:769
#7 0x000055df8831aa25 in ExecModifyTable (pstate=0x55df8a8196a0) at nodeModifyTable.c:2230
#8 0x000055df882efa9a in ExecProcNode (node=0x55df8a8196a0)
at ../../../src/include/executor/executor.h:239
#9 ExecutePlan (execute_once=<optimized out>, dest=0x55df88a89a00 <spi_printtupDR>,
direction=<optimized out>, numberTuples=0, sendTuples=<optimized out>,
operation=CMD_DELETE, use_parallel_mode=<optimized out>, planstate=0x55df8a8196a0,
estate=0x55df8a819058) at execMain.c:1648
#10 standard_ExecutorRun (queryDesc=0x55df8a7de4b0, direction=<optimized out>, count=0,
execute_once=<optimized out>) at execMain.c:365
#11 0x000055df8832b90c in _SPI_pquery (tcount=0, fire_triggers=false,
queryDesc=0x55df8a7de4b0) at spi.c:2521
#12 _SPI_execute_plan (plan=plan@entry=0x55df8a812828, paramLI=<optimized out>,
snapshot=snapshot@entry=0x0, crosscheck_snapshot=crosscheck_snapshot@entry=0x0,
read_only=read_only@entry=false, fire_triggers=fire_triggers@entry=false,
tcount=<optimized out>) at spi.c:2296
#13 0x000055df8832c15c in SPI_execute_snapshot (plan=plan@entry=0x55df8a812828,
Values=Values@entry=0x7ffcf47d5820, Nulls=Nulls@entry=0x7ffcf47d5a20 " ",
snapshot=snapshot@entry=0x0, crosscheck_snapshot=crosscheck_snapshot@entry=0x0,
read_only=read_only@entry=false, fire_triggers=false, tcount=0) at spi.c:616
#14 0x000055df88522f32 in ri_PerformCheck (riinfo=riinfo@entry=0x55df8a7f8050,
qkey=qkey@entry=0x7ffcf47d5b28, qplan=0x55df8a812828,
fk_rel=fk_rel@entry=0x7f3012b54db0, pk_rel=pk_rel@entry=0x7f3012b44a28,
oldslot=oldslot@entry=0x55df8a826f88, newslot=0x0, detectNewRows=true, expect_OK=8)
at ri_triggers.c:2276
#15 0x000055df88524653 in RI_FKey_cascade_del (fcinfo=<optimized out>) at ri_triggers.c:819
#16 0x000055df882c9996 in ExecCallTriggerFunc (trigdata=trigdata@entry=0x7ffcf47d5ff0,
tgindx=tgindx@entry=0, finfo=finfo@entry=0x55df8a825710, instr=instr@entry=0x0,
per_tuple_context=per_tuple_context@entry=0x55df8a812f10) at trigger.c:2432
#17 0x000055df882cb459 in AfterTriggerExecute (trigdesc=0x55df8a825530,
trigdesc=0x55df8a825530, trig_tuple_slot2=0x0, trig_tuple_slot1=0x0,
per_tuple_context=0x55df8a812f10, instr=0x0, finfo=0x55df8a825710,
relInfo=0x55df8a825418, event=0x55df8a81f0a8, estate=0x55df8a825188) at trigger.c:4342
#18 afterTriggerInvokeEvents (events=events@entry=0x55df8a7c3e40, firing_id=1,
estate=estate@entry=0x55df8a825188, delete_ok=delete_ok@entry=false) at trigger.c:4539
#19 0x000055df882d1408 in AfterTriggerEndQuery (estate=estate@entry=0x55df8a825188)
at trigger.c:4850
#20 0x000055df882efd99 in standard_ExecutorFinish (queryDesc=0x55df8a722ab8)
at execMain.c:440
#21 0x000055df88464bdd in ProcessQuery (plan=<optimized out>,
sourceText=0x55df8a702f78 "DELETE FROM t1 RETURNING id;", params=0x0, queryEnv=0x0,
dest=0x55df8a722a20, completionTag=0x7ffcf47d6180 "DELETE 11") at pquery.c:203
#22 0x000055df88464e0b in PortalRunMulti (portal=portal@entry=0x55df8a7692f8,
isTopLevel=isTopLevel@entry=true, setHoldSnapshot=setHoldSnapshot@entry=true,
dest=dest@entry=0x55df8a722a20, altdest=0x55df88a81040 <donothingDR>,
completionTag=completionTag@entry=0x7ffcf47d6180 "DELETE 11") at pquery.c:1283
#23 0x000055df88465119 in FillPortalStore (portal=portal@entry=0x55df8a7692f8,
isTopLevel=isTopLevel@entry=true) at pquery.c:1030
#24 0x000055df88465d1d in PortalRun (portal=portal@entry=0x55df8a7692f8,
count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true,
run_once=run_once@entry=true, dest=dest@entry=0x55df8a7ddb08,
altdest=altdest@entry=0x55df8a7ddb08, completionTag=0x7ffcf47d63b0 "") at pquery.c:765
#25 0x000055df88461512 in exec_simple_query (
query_string=0x55df8a702f78 "DELETE FROM t1 RETURNING id;") at postgres.c:1215
#26 0x000055df8846344e in PostgresMain (argc=<optimized out>,
argv=argv@entry=0x55df8a72d4b0, dbname=<optimized out>, username=<optimized out>)
at postgres.c:4236
#27 0x000055df8811906d in BackendRun (port=0x55df8a7234d0, port=0x55df8a7234d0)
at postmaster.c:4431
#28 BackendStartup (port=0x55df8a7234d0) at postmaster.c:4122
#29 ServerLoop () at postmaster.c:1704
#30 0x000055df883dc53e in PostmasterMain (argc=3, argv=0x55df8a6fb7c0) at postmaster.c:1377
#31 0x000055df8811ad5f in main (argc=3, argv=0x55df8a6fb7c0) at main.c:228
#1 0x00007f301154b801 in __GI_abort () at abort.c:79
#2 0x000055df8858a923 in ExceptionalCondition (
conditionName=conditionName@entry=0x55df885fd138 "!(CheckRelationLockedByMe(idx_rel, 1, 1))", errorType=errorType@entry=0x55df885de8fd "FailedAssertion",
fileName=fileName@entry=0x55df885fca32 "heapam.c", lineNumber=lineNumber@entry=7646)
at assert.c:54
#3 0x000055df88165e53 in ExtractReplicaIdentity (relation=relation@entry=0x7f3012b54db0,
tp=tp@entry=0x7ffcf47d53f0, key_changed=key_changed@entry=true,
copy=copy@entry=0x7ffcf47d53d3) at heapam.c:7646
#4 0x000055df8816c22b in heap_delete (relation=0x7f3012b54db0, tid=<optimized out>,
cid=<optimized out>, crosscheck=0x0, wait=true, tmfd=0x7ffcf47d54b0, changingPart=false)
at heapam.c:2676
#5 0x000055df88318b62 in table_tuple_delete (changingPart=false, tmfd=0x7ffcf47d54b0,
wait=true, crosscheck=<optimized out>, snapshot=<optimized out>, cid=<optimized out>,
tid=0x7ffcf47d558a, rel=0x7f3012b54db0) at ../../../src/include/access/tableam.h:1216
#6 ExecDelete (mtstate=mtstate@entry=0x55df8a8196a0, tupleid=0x7ffcf47d558a, oldtuple=0x0,
planSlot=planSlot@entry=0x55df8a81a8e8, epqstate=epqstate@entry=0x55df8a819798,
estate=estate@entry=0x55df8a819058, processReturning=true, canSetTag=true,
changingPart=false, tupleDeleted=0x0, epqreturnslot=0x0) at nodeModifyTable.c:769
#7 0x000055df8831aa25 in ExecModifyTable (pstate=0x55df8a8196a0) at nodeModifyTable.c:2230
#8 0x000055df882efa9a in ExecProcNode (node=0x55df8a8196a0)
at ../../../src/include/executor/executor.h:239
#9 ExecutePlan (execute_once=<optimized out>, dest=0x55df88a89a00 <spi_printtupDR>,
direction=<optimized out>, numberTuples=0, sendTuples=<optimized out>,
operation=CMD_DELETE, use_parallel_mode=<optimized out>, planstate=0x55df8a8196a0,
estate=0x55df8a819058) at execMain.c:1648
#10 standard_ExecutorRun (queryDesc=0x55df8a7de4b0, direction=<optimized out>, count=0,
execute_once=<optimized out>) at execMain.c:365
#11 0x000055df8832b90c in _SPI_pquery (tcount=0, fire_triggers=false,
queryDesc=0x55df8a7de4b0) at spi.c:2521
#12 _SPI_execute_plan (plan=plan@entry=0x55df8a812828, paramLI=<optimized out>,
snapshot=snapshot@entry=0x0, crosscheck_snapshot=crosscheck_snapshot@entry=0x0,
read_only=read_only@entry=false, fire_triggers=fire_triggers@entry=false,
tcount=<optimized out>) at spi.c:2296
#13 0x000055df8832c15c in SPI_execute_snapshot (plan=plan@entry=0x55df8a812828,
Values=Values@entry=0x7ffcf47d5820, Nulls=Nulls@entry=0x7ffcf47d5a20 " ",
snapshot=snapshot@entry=0x0, crosscheck_snapshot=crosscheck_snapshot@entry=0x0,
read_only=read_only@entry=false, fire_triggers=false, tcount=0) at spi.c:616
#14 0x000055df88522f32 in ri_PerformCheck (riinfo=riinfo@entry=0x55df8a7f8050,
qkey=qkey@entry=0x7ffcf47d5b28, qplan=0x55df8a812828,
fk_rel=fk_rel@entry=0x7f3012b54db0, pk_rel=pk_rel@entry=0x7f3012b44a28,
oldslot=oldslot@entry=0x55df8a826f88, newslot=0x0, detectNewRows=true, expect_OK=8)
at ri_triggers.c:2276
#15 0x000055df88524653 in RI_FKey_cascade_del (fcinfo=<optimized out>) at ri_triggers.c:819
#16 0x000055df882c9996 in ExecCallTriggerFunc (trigdata=trigdata@entry=0x7ffcf47d5ff0,
tgindx=tgindx@entry=0, finfo=finfo@entry=0x55df8a825710, instr=instr@entry=0x0,
per_tuple_context=per_tuple_context@entry=0x55df8a812f10) at trigger.c:2432
#17 0x000055df882cb459 in AfterTriggerExecute (trigdesc=0x55df8a825530,
trigdesc=0x55df8a825530, trig_tuple_slot2=0x0, trig_tuple_slot1=0x0,
per_tuple_context=0x55df8a812f10, instr=0x0, finfo=0x55df8a825710,
relInfo=0x55df8a825418, event=0x55df8a81f0a8, estate=0x55df8a825188) at trigger.c:4342
#18 afterTriggerInvokeEvents (events=events@entry=0x55df8a7c3e40, firing_id=1,
estate=estate@entry=0x55df8a825188, delete_ok=delete_ok@entry=false) at trigger.c:4539
#19 0x000055df882d1408 in AfterTriggerEndQuery (estate=estate@entry=0x55df8a825188)
at trigger.c:4850
#20 0x000055df882efd99 in standard_ExecutorFinish (queryDesc=0x55df8a722ab8)
at execMain.c:440
#21 0x000055df88464bdd in ProcessQuery (plan=<optimized out>,
sourceText=0x55df8a702f78 "DELETE FROM t1 RETURNING id;", params=0x0, queryEnv=0x0,
dest=0x55df8a722a20, completionTag=0x7ffcf47d6180 "DELETE 11") at pquery.c:203
#22 0x000055df88464e0b in PortalRunMulti (portal=portal@entry=0x55df8a7692f8,
isTopLevel=isTopLevel@entry=true, setHoldSnapshot=setHoldSnapshot@entry=true,
dest=dest@entry=0x55df8a722a20, altdest=0x55df88a81040 <donothingDR>,
completionTag=completionTag@entry=0x7ffcf47d6180 "DELETE 11") at pquery.c:1283
#23 0x000055df88465119 in FillPortalStore (portal=portal@entry=0x55df8a7692f8,
isTopLevel=isTopLevel@entry=true) at pquery.c:1030
#24 0x000055df88465d1d in PortalRun (portal=portal@entry=0x55df8a7692f8,
count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true,
run_once=run_once@entry=true, dest=dest@entry=0x55df8a7ddb08,
altdest=altdest@entry=0x55df8a7ddb08, completionTag=0x7ffcf47d63b0 "") at pquery.c:765
#25 0x000055df88461512 in exec_simple_query (
query_string=0x55df8a702f78 "DELETE FROM t1 RETURNING id;") at postgres.c:1215
#26 0x000055df8846344e in PostgresMain (argc=<optimized out>,
argv=argv@entry=0x55df8a72d4b0, dbname=<optimized out>, username=<optimized out>)
at postgres.c:4236
#27 0x000055df8811906d in BackendRun (port=0x55df8a7234d0, port=0x55df8a7234d0)
at postmaster.c:4431
#28 BackendStartup (port=0x55df8a7234d0) at postmaster.c:4122
#29 ServerLoop () at postmaster.c:1704
#30 0x000055df883dc53e in PostmasterMain (argc=3, argv=0x55df8a6fb7c0) at postmaster.c:1377
#31 0x000055df8811ad5f in main (argc=3, argv=0x55df8a6fb7c0) at main.c:228
Вложения
В списке pgsql-hackers по дате отправления:
Предыдущее
От: Anastasia LubennikovaДата:
Сообщение: Re: [HACKERS] [WIP] Effective storage of duplicates in B-tree index.