From: Tom Lane <tgl@sss.pgh.pa.us>
To: sbernikov@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17054: Memory corruption in logical replication worker when replicating into partitioned table
Date: Thu, 10 Jun 2021 20:03:27 -0400
Message-ID: <1819098.1623369807@sss.pgh.pa.us> (raw)
In-Reply-To: <17054-637193af919f0024@postgresql.org>
References: <17054-637193af919f0024@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> When logical replication target is a partitioned table then execution of any
> DDL on source table leads to crash of target (subscriber) server.
Thanks for the report! I duplicated the crash on v13 branch tip,
although it's hitting an assertion failure before reaching any segfault:
#2 0x00000000008f466a in ExceptionalCondition (
conditionName=conditionName@entry=0xa5eae0 "natts == rel->attrmap->maplen", errorType=errorType@entry=0x948cc9 "FailedAssertion",
fileName=fileName@entry=0xa52956 "worker.c",
lineNumber=lineNumber@entry=490) at assert.c:67
#3 0x0000000000777741 in slot_modify_cstrings (slot=slot@entry=0x2ec6e40,
srcslot=<optimized out>, rel=rel@entry=0x2eca918,
values=values@entry=0x7fffb3506480, replaces=replaces@entry=0x7fffb3509880)
at worker.c:490
#4 0x00000000007785e7 in apply_handle_tuple_routing (
edata=edata@entry=0x2ea45a0, remoteslot=remoteslot@entry=0x2ea48a0,
newtup=newtup@entry=0x7fffb3506480, operation=operation@entry=CMD_UPDATE)
at worker.c:1153
#5 0x0000000000778e74 in apply_handle_update (s=s@entry=0x7fffb3509fa0)
at worker.c:846
#6 0x000000000077963c in apply_dispatch (s=0x7fffb3509fa0) at worker.c:1415
#7 LogicalRepApplyLoop (last_received=254887792) at worker.c:1624
#8 ApplyWorkerMain (main_arg=<optimized out>) at worker.c:2171
#9 0x0000000000743ec9 in StartBackgroundWorker () at bgworker.c:890
Interestingly, the same test case does NOT crash for me on master.
So apparently we fixed something that should have been back-patched.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, sbernikov@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17054: Memory corruption in logical replication worker when replicating into partitioned table
In-Reply-To: <1819098.1623369807@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox