Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrUe6-00008Y-UL for pgsql-bugs@arkaria.postgresql.org; Fri, 11 Jun 2021 00:03:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lrUe4-0002Oj-Ig for pgsql-bugs@arkaria.postgresql.org; Fri, 11 Jun 2021 00:03:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrUe4-0002Oa-BC for pgsql-bugs@lists.postgresql.org; Fri, 11 Jun 2021 00:03:32 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrUe2-0003d3-5d for pgsql-bugs@lists.postgresql.org; Fri, 11 Jun 2021 00:03:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 15B03RqS1819099; Thu, 10 Jun 2021 20:03:27 -0400 From: Tom Lane 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 In-reply-to: <17054-637193af919f0024@postgresql.org> References: <17054-637193af919f0024@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 10 Jun 2021 09:21:39 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1819097.1623369807.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 10 Jun 2021 20:03:27 -0400 Message-ID: <1819098.1623369807@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form 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=3DconditionName@entry=3D0xa5eae0 "natts =3D=3D rel->attr= map->maplen", errorType=3DerrorType@entry=3D0x948cc9 "FailedAssertion", = fileName=3DfileName@entry=3D0xa52956 "worker.c", = lineNumber=3DlineNumber@entry=3D490) at assert.c:67 #3 0x0000000000777741 in slot_modify_cstrings (slot=3Dslot@entry=3D0x2ec6= e40, = srcslot=3D, rel=3Drel@entry=3D0x2eca918, = values=3Dvalues@entry=3D0x7fffb3506480, replaces=3Dreplaces@entry=3D0x= 7fffb3509880) at worker.c:490 #4 0x00000000007785e7 in apply_handle_tuple_routing ( edata=3Dedata@entry=3D0x2ea45a0, remoteslot=3Dremoteslot@entry=3D0x2ea= 48a0, = newtup=3Dnewtup@entry=3D0x7fffb3506480, operation=3Doperation@entry=3D= CMD_UPDATE) at worker.c:1153 #5 0x0000000000778e74 in apply_handle_update (s=3Ds@entry=3D0x7fffb3509fa= 0) at worker.c:846 #6 0x000000000077963c in apply_dispatch (s=3D0x7fffb3509fa0) at worker.c:= 1415 #7 LogicalRepApplyLoop (last_received=3D254887792) at worker.c:1624 #8 ApplyWorkerMain (main_arg=3D) 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