Assertion failure when streaming logical changes

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Cc: Andres Freund <andres(at)2ndquadrant(dot)com>
Subject: Assertion failure when streaming logical changes
Date: 2015-02-10 12:20:37
Message-ID: CAB7nPqQSdx7coHk0D6G=mkJntGYjXPDw+PWisKKSsAeZFTskvg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

Using test_decoding on HEAD (cc761b1) I am seeing the following assertion
failure:
TRAP: FailedAssertion("!(!((&RegisteredSnapshots)->ph_root ==
((void*)0)))", File: "snapmgr.c", Line: 677)

(lldb) bt
* thread #1: tid = 0x0000, 0x00007fff8b246d46 libsystem_kernel.dylib`__kill
+ 10, stop reason = signal SIGSTOP
* frame #0: 0x00007fff8b246d46 libsystem_kernel.dylib`__kill + 10
frame #1: 0x00007fff8861bf83 libsystem_c.dylib`abort + 177
frame #2: 0x000000010b556dd9
postgres`ExceptionalCondition(conditionName=0x000000010b66ffcb,
errorType=0x000000010b5c105d, fileName=0x000000010b66fe68, lineNumber=677)
+ 137 at assert.c:54
frame #3: 0x000000010b5af952
postgres`UnregisterSnapshotFromOwner(snapshot=0x00007faea38c22d8,
owner=0x00007faea38a6838) + 146 at snapmgr.c:677
frame #4: 0x000000010b5af8b2
postgres`UnregisterSnapshot(snapshot=0x00007faea38c22d8) + 50 at
snapmgr.c:663
frame #5: 0x000000010b0166ce
postgres`systable_endscan(sysscan=0x00007faea38cf090) + 110 at genam.c:504
frame #6: 0x000000010b5474b8
postgres`RelationBuildTupleDesc(relation=0x0000000114932e68) + 952 at
relcache.c:568
frame #7: 0x000000010b53e45c
postgres`RelationBuildDesc(targetRelId=3455, insertIt='\x01') + 604 at
relcache.c:1035
frame #8: 0x000000010b53d564
postgres`RelationIdGetRelation(relationId=3455) + 324 at relcache.c:1777
frame #9: 0x000000010aff093c postgres`relation_open(relationId=3455,
lockmode=1) + 108 at heapam.c:1047
frame #10: 0x000000010b016ac9 postgres`index_open(relationId=3455,
lockmode=1) + 25 at indexam.c:167
frame #11: 0x000000010b01603d
postgres`systable_beginscan(heapRelation=0x00000001149214d0, indexId=3455,
indexOK='\x01', snapshot=0x0000000000000000, nkeys=2,
key=0x00007fff54c6a990) + 93 at genam.c:334
frame #12: 0x000000010b54a976
postgres`RelidByRelfilenode(reltablespace=0, relfilenode=12709) + 742 at
relfilenodemap.c:204
frame #13: 0x000000010b3353d9
postgres`ReorderBufferCommit(rb=0x00007faea38c1038, xid=1001,
commit_lsn=23817712, end_lsn=23818128, commit_time=476842122105685) + 665
at reorderbuffer.c:1338
frame #14: 0x000000010b330ccb
postgres`DecodeCommit(ctx=0x00007faea38b0838, buf=0x00007fff54c6ad58,
xid=1001, dboid=16384, commit_time=476842122105685, nsubxacts=0,
sub_xids=0x00007faea3885530, ninval_msgs=22, msgs=0x00007faea3885530) + 443
at decode.c:548
frame #15: 0x000000010b32f663
postgres`DecodeXactOp(ctx=0x00007faea38b0838, buf=0x00007fff54c6ad58) + 547
at decode.c:210
frame #16: 0x000000010b32f10e
postgres`LogicalDecodingProcessRecord(ctx=0x00007faea38b0838,
record=0x00007faea38b0af8) + 142 at decode.c:103
frame #17: 0x000000010b3433f5 postgres`XLogSendLogical + 165 at
walsender.c:2425
frame #18: 0x000000010b3431ad
postgres`WalSndLoop(send_data=0x000000010b343350) + 269 at walsender.c:1834
frame #19: 0x000000010b341938
postgres`StartLogicalReplication(cmd=0x00007faea38846a8) + 568 at
walsender.c:997
frame #20: 0x000000010b34021c
postgres`exec_replication_command(cmd_string=0x00007faea3833a38) + 524 at
walsender.c:1326
frame #21: 0x000000010b3abaab postgres`PostgresMain(argc=1,
argv=0x00007faea3803fc8, dbname=0x00007faea3803ec0,
username=0x00007faea3803ea0) + 2475 at postgres.c:4022
frame #22: 0x000000010b312a2e
postgres`BackendRun(port=0x00007faea3405d60) + 686 at postmaster.c:4141
frame #23: 0x000000010b311ff0
postgres`BackendStartup(port=0x00007faea3405d60) + 384 at postmaster.c:3826
frame #24: 0x000000010b30e7f7 postgres`ServerLoop + 663 at
postmaster.c:1594
frame #25: 0x000000010b30c017 postgres`PostmasterMain(argc=3,
argv=0x00007faea34044d0) + 5623 at postmaster.c:1241
frame #26: 0x000000010b24e11d postgres`main(argc=3,
argv=0x00007faea34044d0) + 749 at main.c:221

The problem can be easily reproduced using pg_recvlogical after creating a
logical slot plugged with test_decoding.
Regards,
--
Michael

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-02-10 12:30:51 Re: What exactly is our CRC algorithm?
Previous Message Fabrízio de Royes Mello 2015-02-10 11:17:18 Re: GSoC 2015 - mentors, students and admins.