public inbox for [email protected]  
help / color / mirror / Atom feed
From: [email protected] <[email protected]>
To: Masahiko Sawada <[email protected]>
To: Amit Kapila <[email protected]>
Cc: Kyotaro Horiguchi <[email protected]>
Cc: Drouvot, Bertrand <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Oh, Mike <[email protected]>
Subject: RE: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns
Date: Tue, 12 Jul 2022 08:58:50 +0000
Message-ID: <TYAPR01MB6315DC425D32E9579B61EDF1FD869@TYAPR01MB6315.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <CAD21AoC4+GeT_HRnCFuy0L37FHUSXOPEpXYp0wbQnFxCMiuD=Q@mail.gmail.com>
References: <[email protected]>
	<CAD21AoD00wV4gt-53ze+ZB8n4bqJrdH8J_UnDHddy8S2A+a25g@mail.gmail.com>
	<CAA4eK1L_e4r4=10TTzoOiWGQ6hH4vxWAwD=0aofz04czCTV0kQ@mail.gmail.com>
	<[email protected]>
	<CAA4eK1JoKV2qmp916gFk=9SX=Qo21+sN4n-yjbB2b0Q1xxOKJw@mail.gmail.com>
	<CAD21AoAn9T6mS8sMF5=tFV66Wru92s933ihRVunLPEU_+0=Xiw@mail.gmail.com>
	<CAA4eK1Lgfj2ww4V_zMxTmduB0BQpEsS-j7RT8BV-cy7Qyp1E3A@mail.gmail.com>
	<CAD21AoDNJgYkrO1PQ=k6G9MfvRjhawMN-aZVT2spMr_ymmOhCQ@mail.gmail.com>
	<CAD21AoC4x3uOw5rUcSYZkWob5s5ottGt_RPLxCEpHimFRDjrEg@mail.gmail.com>
	<CAA4eK1L_Br0wNHwY1PrnusX1H2bvWR+iUnNC=1anKqhPBtnoMg@mail.gmail.com>
	<CAA4eK1KMsU5PFHOvTD=3jHQ6aPa8N39eGwAVMVA6S0sXw1kMdw@mail.gmail.com>
	<CAD21AoD8v=pE+3AMezPrWJo=hpijNmop-XRbZ=3YG5zT5pBMnQ@mail.gmail.com>
	<CAA4eK1KuSxRhwUoJWVW--EseKcob94-hrP+JMCGvGTR+Fnx2aA@mail.gmail.com>
	<CAD21AoBHo3WQ+vaeiNzXuNw__08veBT9qYgCUD3jNLWG=4GzFw@mail.gmail.com>
	<CAA4eK1KMegGo+QwMxJcHMbYN-3QOLH6hD2thWXA2_M3MLH01Ug@mail.gmail.com>
	<CAD21AoCF=8SKOJYWF12fPEwXc5GLU2SvhfZ3QoR93Qqn+6oeSg@mail.gmail.com>
	<CAA4eK1LuFtCifCBY=uB_Orzjx-tc0O8DZqfFE_JuHptngeCcwA@mail.gmail.com>
	<CAD21AoCBPL10=X83g6J2CXQRE11kXgiyzfVY2m=hS1O7YRqiWQ@mail.gmail.com>
	<CAA4eK1JyJL7dACPQ51hQmSz5KrxghmABr_J9AZbSGzSLW3Ghig@mail.gmail.com>
	<CAD21AoCAPkPxsqbe6ZTqOe0bcVrEWHmA3ObYQtyu0Bv8hC=z_g@mail.gmail.com>
	<CAD21AoC4+GeT_HRnCFuy0L37FHUSXOPEpXYp0wbQnFxCMiuD=Q@mail.gmail.com>

On Tue, Jul 12, 2022 8:49 AM Masahiko Sawada <[email protected]> wrote:
> 
> I've attached an updated patch.
> 

Hi,

I met a segmentation fault in test_decoding test after applying the patch for master
branch. Attach the backtrace.

It happened when executing the following code because it tried to free a NULL
pointer (catchange_xip).

	/* be tidy */
 	if (ondisk)
 		pfree(ondisk);
+	if (catchange_xip)
+		pfree(catchange_xip);
 }

It seems to be related to configure option. I could reproduce it when using
`./configure --enable-debug`.
But I couldn't reproduce with `./configure --enable-debug CFLAGS="-Og -ggdb"`.

Regards,
Shi yu

#0  0x0000000000910333 in GetMemoryChunkContext (pointer=0x0) at ../../../../src/include/utils/memutils.h:129
#1  pfree (pointer=0x0) at mcxt.c:1177
#2  0x000000000078186b in SnapBuildSerialize (builder=0x1fd5e78, lsn=25719712) at snapbuild.c:1792
#3  0x0000000000782797 in SnapBuildProcessRunningXacts (builder=0x1fd5e78, lsn=25719712, running=0x27dfe50) at snapbuild.c:1199
#4  0x0000000000774273 in standby_decode (ctx=0x1fc3e08, buf=0x7ffd8c95b5d0) at decode.c:346
#5  0x0000000000773ab3 in LogicalDecodingProcessRecord (ctx=ctx@entry=0x1fc3e08, record=0x1fc41a0) at decode.c:119
#6  0x000000000077815d in pg_logical_slot_get_changes_guts (fcinfo=0x1fb5d88, confirm=<optimized out>, binary=<optimized out>) at logicalfuncs.c:271
#7  0x000000000067b63d in ExecMakeTableFunctionResult (setexpr=0x1fb42e0, econtext=0x1fb41b0, argContext=<optimized out>, expectedDesc=0x1fd7da8, randomAccess=false)
    at execSRF.c:234
#8  0x000000000068b76f in FunctionNext (node=node@entry=0x1fb3fa0) at nodeFunctionscan.c:94
#9  0x000000000067be37 in ExecScanFetch (recheckMtd=0x68b450 <FunctionRecheck>, accessMtd=0x68b470 <FunctionNext>, node=0x1fb3fa0) at execScan.c:133
#10 ExecScan (node=0x1fb3fa0, accessMtd=0x68b470 <FunctionNext>, recheckMtd=0x68b450 <FunctionRecheck>) at execScan.c:199
#11 0x000000000067344b in ExecProcNode (node=0x1fb3fa0) at ../../../src/include/executor/executor.h:259
#12 ExecutePlan (execute_once=<optimized out>, dest=0x1fc02e8, direction=<optimized out>, numberTuples=0, sendTuples=<optimized out>, operation=CMD_SELECT,
    use_parallel_mode=<optimized out>, planstate=0x1fb3fa0, estate=0x1fb3d78) at execMain.c:1636
#13 standard_ExecutorRun (queryDesc=0x1f9e178, direction=<optimized out>, count=0, execute_once=<optimized out>) at execMain.c:363
#14 0x00000000007dda9e in PortalRunSelect (portal=0x1f51338, forward=<optimized out>, count=0, dest=<optimized out>) at pquery.c:924
#15 0x00000000007decf7 in PortalRun (portal=portal@entry=0x1f51338, count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true,
    run_once=run_once@entry=true, dest=dest@entry=0x1fc02e8, altdest=altdest@entry=0x1fc02e8, qc=0x7ffd8c95bbf0) at pquery.c:768
#16 0x00000000007db4ff in exec_simple_query (
    query_string=0x1ee29a8 "SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'skip-empty-xacts', '1', 'include-xids', '0');")
    at postgres.c:1243
#17 0x00000000007dc742 in PostgresMain (dbname=<optimized out>, username=<optimized out>) at postgres.c:4482
#18 0x000000000076132b in BackendRun (port=<optimized out>, port=<optimized out>) at postmaster.c:4503
#19 BackendStartup (port=<optimized out>) at postmaster.c:4231
#20 ServerLoop () at postmaster.c:1805
#21 0x00000000007621fb in PostmasterMain (argc=argc@entry=3, argv=argv@entry=0x1edbf20) at postmaster.c:1477
#22 0x00000000004f0f69 in main (argc=3, argv=0x1edbf20) at main.c:202


Attachments:

  [text/plain] backtrace.txt (2.8K, ../TYAPR01MB6315DC425D32E9579B61EDF1FD869@TYAPR01MB6315.jpnprd01.prod.outlook.com/2-backtrace.txt)
  download | inline:
#0  0x0000000000910333 in GetMemoryChunkContext (pointer=0x0) at ../../../../src/include/utils/memutils.h:129
#1  pfree (pointer=0x0) at mcxt.c:1177
#2  0x000000000078186b in SnapBuildSerialize (builder=0x1fd5e78, lsn=25719712) at snapbuild.c:1792
#3  0x0000000000782797 in SnapBuildProcessRunningXacts (builder=0x1fd5e78, lsn=25719712, running=0x27dfe50) at snapbuild.c:1199
#4  0x0000000000774273 in standby_decode (ctx=0x1fc3e08, buf=0x7ffd8c95b5d0) at decode.c:346
#5  0x0000000000773ab3 in LogicalDecodingProcessRecord (ctx=ctx@entry=0x1fc3e08, record=0x1fc41a0) at decode.c:119
#6  0x000000000077815d in pg_logical_slot_get_changes_guts (fcinfo=0x1fb5d88, confirm=<optimized out>, binary=<optimized out>) at logicalfuncs.c:271
#7  0x000000000067b63d in ExecMakeTableFunctionResult (setexpr=0x1fb42e0, econtext=0x1fb41b0, argContext=<optimized out>, expectedDesc=0x1fd7da8, randomAccess=false)
    at execSRF.c:234
#8  0x000000000068b76f in FunctionNext (node=node@entry=0x1fb3fa0) at nodeFunctionscan.c:94
#9  0x000000000067be37 in ExecScanFetch (recheckMtd=0x68b450 <FunctionRecheck>, accessMtd=0x68b470 <FunctionNext>, node=0x1fb3fa0) at execScan.c:133
#10 ExecScan (node=0x1fb3fa0, accessMtd=0x68b470 <FunctionNext>, recheckMtd=0x68b450 <FunctionRecheck>) at execScan.c:199
#11 0x000000000067344b in ExecProcNode (node=0x1fb3fa0) at ../../../src/include/executor/executor.h:259
#12 ExecutePlan (execute_once=<optimized out>, dest=0x1fc02e8, direction=<optimized out>, numberTuples=0, sendTuples=<optimized out>, operation=CMD_SELECT,
    use_parallel_mode=<optimized out>, planstate=0x1fb3fa0, estate=0x1fb3d78) at execMain.c:1636
#13 standard_ExecutorRun (queryDesc=0x1f9e178, direction=<optimized out>, count=0, execute_once=<optimized out>) at execMain.c:363
#14 0x00000000007dda9e in PortalRunSelect (portal=0x1f51338, forward=<optimized out>, count=0, dest=<optimized out>) at pquery.c:924
#15 0x00000000007decf7 in PortalRun (portal=portal@entry=0x1f51338, count=count@entry=9223372036854775807, isTopLevel=isTopLevel@entry=true,
    run_once=run_once@entry=true, dest=dest@entry=0x1fc02e8, altdest=altdest@entry=0x1fc02e8, qc=0x7ffd8c95bbf0) at pquery.c:768
#16 0x00000000007db4ff in exec_simple_query (
    query_string=0x1ee29a8 "SELECT data FROM pg_logical_slot_get_changes('isolation_slot', NULL, NULL, 'skip-empty-xacts', '1', 'include-xids', '0');")
    at postgres.c:1243
#17 0x00000000007dc742 in PostgresMain (dbname=<optimized out>, username=<optimized out>) at postgres.c:4482
#18 0x000000000076132b in BackendRun (port=<optimized out>, port=<optimized out>) at postmaster.c:4503
#19 BackendStartup (port=<optimized out>) at postmaster.c:4231
#20 ServerLoop () at postmaster.c:1805
#21 0x00000000007621fb in PostmasterMain (argc=argc@entry=3, argv=argv@entry=0x1edbf20) at postmaster.c:1477
#22 0x00000000004f0f69 in main (argc=3, argv=0x1edbf20) at main.c:202

view thread (136+ messages)  latest in thread

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: RE: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns
  In-Reply-To: <TYAPR01MB6315DC425D32E9579B61EDF1FD869@TYAPR01MB6315.jpnprd01.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox