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 1lRyy4-0007mX-PF for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Apr 2021 15:10:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lRyy3-0004Qp-Ny for pgsql-hackers@arkaria.postgresql.org; Thu, 01 Apr 2021 15:10:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRyx6-0001XD-7M for pgsql-hackers@lists.postgresql.org; Thu, 01 Apr 2021 15:09:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRyx3-0006oe-Nq for pgsql-hackers@lists.postgresql.org; Thu, 01 Apr 2021 15:09:43 +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 131F9aHp3411578; Thu, 1 Apr 2021 11:09:36 -0400 From: Tom Lane To: Etsuro Fujita cc: Kyotaro Horiguchi , Justin Pryzby , Andrey Lepikhov , PostgreSQL Hackers Subject: Re: Asynchronous Append on postgres_fdw nodes. In-reply-to: References: <20210218.151557.1106337659785292399.horikyota.ntt@gmail.com> Comments: In-reply-to Etsuro Fujita message dated "Wed, 31 Mar 2021 18:55:22 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3411576.1617289776.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 01 Apr 2021 11:09:36 -0400 Message-ID: <3411577.1617289776@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Etsuro Fujita writes: > Pushed. The buildfarm points out that this fails under valgrind. I easily reproduced it here: =3D=3D00:00:03:42.115 3410499=3D=3D Syscall param epoll_wait(events) point= s to unaddressable byte(s) =3D=3D00:00:03:42.115 3410499=3D=3D at 0x58E926B: epoll_wait (epoll_wai= t.c:30) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x7FC903: WaitEventSetWaitBlock = (latch.c:1452) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x7FC903: WaitEventSetWait (latc= h.c:1398) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x6BF46C: ExecAppendAsyncEventWa= it (nodeAppend.c:1025) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x6BF667: ExecAppendAsyncGetNext= (nodeAppend.c:915) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x6BF667: ExecAppend (nodeAppend= .c:337) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x6D49E4: ExecProcNode (executor= .h:257) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x6D49E4: ExecModifyTable (nodeM= odifyTable.c:2222) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x6A87F2: ExecProcNode (executor= .h:257) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x6A87F2: ExecutePlan (execMain.= c:1531) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x6A87F2: standard_ExecutorRun (= execMain.c:350) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x82597F: ProcessQuery (pquery.c= :160) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x825BE9: PortalRunMulti (pquery= .c:1267) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x826826: PortalRun (pquery.c:77= 9) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x82291E: exec_simple_query (pos= tgres.c:1185) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x823F3E: PostgresMain (postgres= .c:4415) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x79BAC1: BackendRun (postmaster= .c:4483) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x79BAC1: BackendStartup (postma= ster.c:4205) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x79BAC1: ServerLoop (postmaster= .c:1737) =3D=3D00:00:03:42.115 3410499=3D=3D Address 0x10d10628 is 7,960 bytes ins= ide a recently re-allocated block of size 8,192 alloc'd =3D=3D00:00:03:42.115 3410499=3D=3D at 0x4C30F0B: malloc (vg_replace_ma= lloc.c:307) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x94F9EA: AllocSetAlloc (aset.c:= 919) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x957BAF: MemoryContextAlloc (mc= xt.c:809) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x958CC0: MemoryContextStrdup (m= cxt.c:1179) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x516AE4: untransformRelOptions = (reloptions.c:1336) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x6E6ADF: GetForeignTable (forei= gn.c:273) =3D=3D00:00:03:42.115 3410499=3D=3D by 0xF3BD470: postgresBeginForeignS= can (postgres_fdw.c:1479) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x6C2E83: ExecInitForeignScan (n= odeForeignscan.c:236) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x6AF893: ExecInitNode (execProc= node.c:283) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x6C0007: ExecInitAppend (nodeAp= pend.c:232) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x6AFA37: ExecInitNode (execProc= node.c:180) =3D=3D00:00:03:42.115 3410499=3D=3D by 0x6D533A: ExecInitModifyTable (n= odeModifyTable.c:2575) =3D=3D00:00:03:44.907 3410499=3D=3D Syscall param epoll_wait(events) point= s to unaddressable byte(s) =3D=3D00:00:03:44.907 3410499=3D=3D at 0x58E926B: epoll_wait (epoll_wai= t.c:30) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x7FC903: WaitEventSetWaitBlock = (latch.c:1452) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x7FC903: WaitEventSetWait (latc= h.c:1398) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x6BF46C: ExecAppendAsyncEventWa= it (nodeAppend.c:1025) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x6BF718: ExecAppend (nodeAppend= .c:370) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x6D49E4: ExecProcNode (executor= .h:257) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x6D49E4: ExecModifyTable (nodeM= odifyTable.c:2222) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x6A87F2: ExecProcNode (executor= .h:257) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x6A87F2: ExecutePlan (execMain.= c:1531) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x6A87F2: standard_ExecutorRun (= execMain.c:350) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x82597F: ProcessQuery (pquery.c= :160) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x825BE9: PortalRunMulti (pquery= .c:1267) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x826826: PortalRun (pquery.c:77= 9) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x82291E: exec_simple_query (pos= tgres.c:1185) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x823F3E: PostgresMain (postgres= .c:4415) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x79BAC1: BackendRun (postmaster= .c:4483) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x79BAC1: BackendStartup (postma= ster.c:4205) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x79BAC1: ServerLoop (postmaster= .c:1737) =3D=3D00:00:03:44.907 3410499=3D=3D Address 0x1093fdd8 is 2,904 bytes ins= ide a recently re-allocated block of size 16,384 alloc'd =3D=3D00:00:03:44.907 3410499=3D=3D at 0x4C30F0B: malloc (vg_replace_ma= lloc.c:307) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x94F9EA: AllocSetAlloc (aset.c:= 919) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x958233: palloc (mcxt.c:964) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x69C400: ExprEvalPushStep (exec= Expr.c:2310) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x69C541: ExecPushExprSlots (exe= cExpr.c:2490) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x69C580: ExecInitExprSlots (exe= cExpr.c:2445) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x69F0DD: ExecInitQual (execExpr= .c:231) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x6D80EF: ExecInitSeqScan (nodeS= eqscan.c:172) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x6AF9CE: ExecInitNode (execProc= node.c:208) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x6C0007: ExecInitAppend (nodeAp= pend.c:232) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x6AFA37: ExecInitNode (execProc= node.c:180) =3D=3D00:00:03:44.907 3410499=3D=3D by 0x6D533A: ExecInitModifyTable (n= odeModifyTable.c:2575) =3D=3D00:00:03:44.907 3410499=3D=3D = Sorta looks like something is relying on a pointer into the relcache to be valid for longer than it can safely rely on that. The CLOBBER_CACHE_ALWAYS animals will probably be unhappy too, but they are slower than valgrind. (Note that the test case appears to succeed, you have to notice that the backend crashed after exiting.) regards, tom lane