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 1lerFM-0007SP-7D for pgsql-hackers@arkaria.postgresql.org; Fri, 07 May 2021 03:33:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lerEp-0002Qu-Ds for pgsql-hackers@arkaria.postgresql.org; Fri, 07 May 2021 03:33:15 +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 1lerEp-0002Qm-2p for pgsql-hackers@lists.postgresql.org; Fri, 07 May 2021 03:33:15 +0000 Received: from mail-m127148.qiye.163.com ([115.236.127.148]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lerEh-0000dP-CY for pgsql-hackers@postgresql.org; Fri, 07 May 2021 03:33:11 +0000 Received: from activesync-3.qy.internal (activesync-3.qy.internal [127.0.0.1]) by mail-m127148.qiye.163.com (Hmail) with ESMTP id D3505A81A1B for ; Fri, 7 May 2021 11:32:58 +0800 (CST) From: "Pengchengliu" To: References: In-Reply-To: Subject: Parallel scan with SubTransGetTopmostTransaction assert coredump Date: Fri, 7 May 2021 11:32:57 +0800 Message-ID: <000901d742f1$acae3ad0$060ab070$@tju.edu.cn> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000A_01D74334.BAD3EBD0" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJWZzOrsYDN3Ar+nCJfWwrfcv+5KanZFJug Content-Language: zh-cn X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZGUlLS1ZDShpCQ05DHxgYHRlVEwETFhoSFyQUDg9ZV1kWGg8SFR0UWUFZT0tIVUpKS0 JITlVLWQY+ X-HM-Sender-Digest: e1kMHhlZQQ8JDh5XWRIfHhUPWUFZRzoxKjo3DDgLPw4KQgIMK0kBGiIX IRoLCVVKVUpNSUtITkNITEJISkhVMxYaEhdVCx4VHBgTHhUcFxIOOw8RDlUeHw5VGBVFWVdZEgtZ QVlJSkNVSVVCTFVCSVlXWQgBWUFITk5JSjcG X-HM-Tid: 0a7944e2b5919894kuuud3505a81a1b List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multipart message in MIME format. ------=_NextPart_000_000A_01D74334.BAD3EBD0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Hackers=EF=BC=8C Last email, format error, missing some information, so I resend this = email. =20 With PG 13.2(3fb4c75e857adee3da4386e947ba58a75f3e74b7), I tested = subtransaction with parallel scan, I got a subtransaction coredump as = below: =20 ``` (gdb) bt #0 0x00001517ce61f7ff in raise () from /lib64/libc.so.6 #1 0x00001517ce609c35 in abort () from /lib64/libc.so.6 #2 0x0000000000aaf93f in ExceptionalCondition (conditionName=3D0xb4c920 = "TransactionIdFollowsOrEquals(xid, TransactionXmin)", = errorType=3D0xb4c796 "FailedAssertion",=20 fileName=3D0xb4c738 = "/home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acce= ss/transam/subtrans.c", lineNumber=3D156) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/utils= /error/assert.c:67 #3 0x0000000000563111 in SubTransGetTopmostTransaction (xid=3D196963) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/transam/subtrans.c:156 #4 0x0000000000b05206 in XidInMVCCSnapshot (xid=3D196963, = snapshot=3D0x2f8ec58) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/utils= /time/snapmgr.c:2293 #5 0x00000000004ff2bc in HeapTupleSatisfiesMVCC (htup=3D0x7ffc21807120, = snapshot=3D0x2f8ec58, buffer=3D1946) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/heap/heapam_visibility.c:1073 #6 0x0000000000500363 in HeapTupleSatisfiesVisibility = (tup=3D0x7ffc21807120, snapshot=3D0x2f8ec58, buffer=3D1946) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/heap/heapam_visibility.c:1695 #7 0x00000000004e423b in heapgetpage (sscan=3D0x2f8e840, page=3D1685) = at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/heap/heapam.c:447 #8 0x00000000004e68bf in heapgettup_pagemode (scan=3D0x2f8e840, = dir=3DForwardScanDirection, nkeys=3D0, key=3D0x0) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/heap/heapam.c:1077 #9 0x00000000004e6eb6 in heap_getnextslot (sscan=3D0x2f8e840, = direction=3DForwardScanDirection, slot=3D0x2fd8a38) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/heap/heapam.c:1333 #10 0x000000000075350e in table_scan_getnextslot (sscan=3D0x2f8e840, = direction=3DForwardScanDirection, slot=3D0x2fd8a38) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/include/acces= s/tableam.h:906 #11 0x00000000007535d6 in SeqNext (node=3D0x2fd86a8) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/nodeSeqscan.c:80 #12 0x000000000071af3c in ExecScanFetch (node=3D0x2fd86a8, = accessMtd=3D0x753542 , recheckMtd=3D0x7535e7 ) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/execScan.c:133 #13 0x000000000071afdd in ExecScan (node=3D0x2fd86a8, = accessMtd=3D0x753542 , recheckMtd=3D0x7535e7 ) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/execScan.c:199 #14 0x0000000000753631 in ExecSeqScan (pstate=3D0x2fd86a8) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/nodeSeqscan.c:112 #15 0x00000000007173af in ExecProcNodeFirst (node=3D0x2fd86a8) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/execProcnode.c:450 #16 0x000000000070b7f7 in ExecProcNode (node=3D0x2fd86a8) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/include/execu= tor/executor.h:248 #17 0x000000000070e302 in ExecutePlan (estate=3D0x2fd7ca0, = planstate=3D0x2fd86a8, use_parallel_mode=3Dfalse, = operation=3DCMD_SELECT, sendTuples=3Dtrue, numberTuples=3D0,=20 direction=3DForwardScanDirection, dest=3D0x2f8ddd8, = execute_once=3Dtrue) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/execMain.c:1632 #18 0x000000000070be22 in standard_ExecutorRun (queryDesc=3D0x2f8e7a8, = direction=3DForwardScanDirection, count=3D0, execute_once=3Dtrue) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/execMain.c:350 #19 0x000000000070bc50 in ExecutorRun (queryDesc=3D0x2f8e7a8, = direction=3DForwardScanDirection, count=3D0, execute_once=3Dtrue) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/execMain.c:294 #20 0x00000000007131d5 in ParallelQueryMain (seg=3D0x2ef30b8, = toc=3D0x1517cf85c000) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/execParallel.c:1448 #21 0x000000000055f70c in ParallelWorkerMain (main_arg=3D897455922) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/transam/parallel.c:1470 #22 0x000000000086e255 in StartBackgroundWorker () at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/postm= aster/bgworker.c:879 #23 0x000000000088192c in do_start_bgworker (rw=3D0x2f221c0) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/postm= aster/postmaster.c:5870 #24 0x0000000000881cd8 in maybe_start_bgworkers () at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/postm= aster/postmaster.c:6095 #25 0x0000000000880d14 in sigusr1_handler (postgres_signal_arg=3D10) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/postm= aster/postmaster.c:5255 #26 #27 0x00001517ce6dc4bb in select () from /lib64/libc.so.6 #28 0x000000000087c867 in ServerLoop () at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/postm= aster/postmaster.c:1703 #29 0x000000000087c232 in PostmasterMain (argc=3D3, argv=3D0x2ef1070) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/postm= aster/postmaster.c:1412 #30 0x0000000000783418 in main (argc=3D3, argv=3D0x2ef1070) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/main/= main.c:210 (gdb) f 3 #3 0x0000000000563111 in SubTransGetTopmostTransaction (xid=3D196963) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/transam/subtrans.c:325 325 Assert(TransactionIdFollowsOrEquals(xid, = TransactionXmin)); (gdb) p xid $1 =3D 196963 (gdb) f 4 #4 0x0000000000b05206 in XidInMVCCSnapshot (xid=3D196963, = snapshot=3D0x2f8ec58) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/utils= /time/snapmgr.c:2293 2293 xid =3D = SubTransGetTopmostTransaction(xid); (gdb) p *snapshot $2 =3D {snapshot_type =3D SNAPSHOT_MVCC, xmin =3D 196962, xmax =3D = 210314, xip =3D 0x2f8ecc0, xcnt =3D 82, subxip =3D 0x0, subxcnt =3D 0, = suboverflowed =3D true,=20 takenDuringRecovery =3D false, copied =3D true, curcid =3D 14, = speculativeToken =3D 2139062143, active_count =3D 0, regd_count =3D 1, = ph_node =3D {first_child =3D 0x0,=20 next_sibling =3D 0xf65ca0 , prev_or_parent = =3D 0x2f8dbc8}, whenTaken =3D 0, lsn =3D 0} (gdb) p TransactionXmin $3 =3D 196992 (gdb) f 3 #3 0x0000000000563111 in SubTransGetTopmostTransaction (xid=3D196963) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/transam/subtrans.c:325 325 Assert(TransactionIdFollowsOrEquals(xid, = TransactionXmin)); (gdb) p xid $4 =3D 196963 (gdb) p TransactionXmin $5 =3D 196992 ``` =20 After simple analyze, I think it should be a bug. =20 1, Main process first get active snapshot(xmin 196962, xmax 210314), and = push active snapshot.=20 2, Main process call InitializeParallelDSM, get transaction = snapshot(xmin 196992, xmax 210320), and send this snapshot with = parameters PARALLEL_KEY_TRANSACTION_SNAPSHOT. 3, Main process call = ExecParallelInitializeDSM->ExecSeqScanInitializeDSM->table_parallelscan_i= nitialize SerializeSnapshot active snapshot(xmin 196962, xmax 210314) 4, Main process Lanch Parallel Workers process. =20 Parallel Workers process work flow: 1, = ParallelWorkerMain->BackgroundWorkerInitializeConnectionByOid->GetTransac= tionSnapshot(xmin 196992, xmax 210320) and set TransactionXmin to = 196992. 2, = ParallelWorkerMain->RestoreTransactionSnapshot->SetTransactionSnapshot->P= rocArrayInstallRestoredXmin and set TransactionXmin to 196992. 3, = ParallelWorkerMain->ExecParallelInitializeWorker->ExecSeqScanInitializeWo= rker->table_beginscan_parallel restore active snapshot(xmin 196962, xmax = 210314) from main process. 4, Got coredump = ParallelWorkerMain->ParallelQueryMain->ExecutorRun...ExecScan->heapgetpag= e->HeapTupleSatisfiesMVCC->XidInMVCCSnapshot->SubTransGetTopmostTransacti= on=20 =20 So the root cause is the Parallel Workers process set the = TransactionXmin with later transcation snapshot. When parallel scan, = Parallel Workers process use the older active snapshot. It leads to subtrans assert coredump. I don't know how to fix it. Is = there any ideas? =20 Thanks Pengcheng =20 =20 =20 ------=_NextPart_000_000A_01D74334.BAD3EBD0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

Hi Hackers=EF=BC=8C

Last = email, format error, missing some information, so I resend this email. = =C2=A0

=C2=A0With PG = 13.2(3fb4c75e857adee3da4386e947ba58a75f3e74b7), I tested subtransaction = with parallel scan, I got a subtransaction coredump as = below:

 

```=

(gd= b) bt

#0&= nbsp; 0x00001517ce61f7ff in raise () from = /lib64/libc.so.6

#1&= nbsp; 0x00001517ce609c35 in abort () from = /lib64/libc.so.6

#2&= nbsp; 0x0000000000aaf93f in ExceptionalCondition = (conditionName=3D0xb4c920 "TransactionIdFollowsOrEquals(xid, = TransactionXmin)", errorType=3D0xb4c796 = "FailedAssertion", 

&nb= sp;   fileName=3D0xb4c738 = "/home/liupc/build/build_postgres2/../../devel/postgres2/src/backend= /access/transam/subtrans.c", = lineNumber=3D156)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/utils= /error/assert.c:67

#3&= nbsp; 0x0000000000563111 in SubTransGetTopmostTransaction = (xid=3D196963)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/transam/subtrans.c:156

#4&= nbsp; 0x0000000000b05206 in XidInMVCCSnapshot (xid=3D196963, = snapshot=3D0x2f8ec58)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/utils= /time/snapmgr.c:2293

#5&= nbsp; 0x00000000004ff2bc in HeapTupleSatisfiesMVCC = (htup=3D0x7ffc21807120, snapshot=3D0x2f8ec58, = buffer=3D1946)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/heap/heapam_visibility.c:1073

#6&= nbsp; 0x0000000000500363 in HeapTupleSatisfiesVisibility = (tup=3D0x7ffc21807120, snapshot=3D0x2f8ec58, = buffer=3D1946)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/heap/heapam_visibility.c:1695

#7&= nbsp; 0x00000000004e423b in heapgetpage (sscan=3D0x2f8e840, page=3D1685) = at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/heap/heapam.c:447

#8&= nbsp; 0x00000000004e68bf in heapgettup_pagemode (scan=3D0x2f8e840, = dir=3DForwardScanDirection, nkeys=3D0, = key=3D0x0)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/heap/heapam.c:1077

#9&= nbsp; 0x00000000004e6eb6 in heap_getnextslot (sscan=3D0x2f8e840, = direction=3DForwardScanDirection, = slot=3D0x2fd8a38)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/heap/heapam.c:1333

#10= 0x000000000075350e in table_scan_getnextslot (sscan=3D0x2f8e840, = direction=3DForwardScanDirection, = slot=3D0x2fd8a38)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/include/acces= s/tableam.h:906

#11= 0x00000000007535d6 in SeqNext (node=3D0x2fd86a8) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/nodeSeqscan.c:80

#12= 0x000000000071af3c in ExecScanFetch (node=3D0x2fd86a8, = accessMtd=3D0x753542 <SeqNext>, recheckMtd=3D0x7535e7 = <SeqRecheck>)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/execScan.c:133

#13= 0x000000000071afdd in ExecScan (node=3D0x2fd86a8, accessMtd=3D0x753542 = <SeqNext>, recheckMtd=3D0x7535e7 = <SeqRecheck>)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/execScan.c:199

#14= 0x0000000000753631 in ExecSeqScan (pstate=3D0x2fd86a8) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/nodeSeqscan.c:112

#15= 0x00000000007173af in ExecProcNodeFirst (node=3D0x2fd86a8) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/execProcnode.c:450

#16= 0x000000000070b7f7 in ExecProcNode (node=3D0x2fd86a8) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/include/execu= tor/executor.h:248

#17= 0x000000000070e302 in ExecutePlan (estate=3D0x2fd7ca0, = planstate=3D0x2fd86a8, use_parallel_mode=3Dfalse, = operation=3DCMD_SELECT, sendTuples=3Dtrue, = numberTuples=3D0, 

&nb= sp;   direction=3DForwardScanDirection, dest=3D0x2f8ddd8, = execute_once=3Dtrue) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/execMain.c:1632

#18= 0x000000000070be22 in standard_ExecutorRun (queryDesc=3D0x2f8e7a8, = direction=3DForwardScanDirection, count=3D0, = execute_once=3Dtrue)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/execMain.c:350

#19= 0x000000000070bc50 in ExecutorRun (queryDesc=3D0x2f8e7a8, = direction=3DForwardScanDirection, count=3D0, = execute_once=3Dtrue)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/execMain.c:294

#20= 0x00000000007131d5 in ParallelQueryMain (seg=3D0x2ef30b8, = toc=3D0x1517cf85c000)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/execu= tor/execParallel.c:1448

#21= 0x000000000055f70c in ParallelWorkerMain (main_arg=3D897455922) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/transam/parallel.c:1470

#22= 0x000000000086e255 in StartBackgroundWorker () at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/postm= aster/bgworker.c:879

#23= 0x000000000088192c in do_start_bgworker (rw=3D0x2f221c0) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/postm= aster/postmaster.c:5870

#24= 0x0000000000881cd8 in maybe_start_bgworkers () at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/postm= aster/postmaster.c:6095

#25= 0x0000000000880d14 in sigusr1_handler (postgres_signal_arg=3D10) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/postm= aster/postmaster.c:5255

#26= <signal handler called>

#27= 0x00001517ce6dc4bb in select () from = /lib64/libc.so.6

#28= 0x000000000087c867 in ServerLoop () at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/postm= aster/postmaster.c:1703

#29= 0x000000000087c232 in PostmasterMain (argc=3D3, argv=3D0x2ef1070) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/postm= aster/postmaster.c:1412

#30= 0x0000000000783418 in main (argc=3D3, argv=3D0x2ef1070) at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/main/= main.c:210

(gd= b) f 3

#3&= nbsp; 0x0000000000563111 in SubTransGetTopmostTransaction = (xid=3D196963)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/transam/subtrans.c:325

325=             =  Assert(TransactionIdFollowsOrEquals(xid, = TransactionXmin));

(gd= b) p xid

$1 = =3D 196963

(gd= b) f 4

#4&= nbsp; 0x0000000000b05206 in XidInMVCCSnapshot (xid=3D196963, = snapshot=3D0x2f8ec58)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/utils= /time/snapmgr.c:2293

229= 3                    =         xid =3D = SubTransGetTopmostTransaction(xid);

(gd= b) p *snapshot

$2 = =3D {snapshot_type =3D SNAPSHOT_MVCC, xmin =3D 196962, xmax =3D 210314, = xip =3D 0x2f8ecc0, xcnt =3D 82, subxip =3D 0x0, subxcnt =3D 0, = suboverflowed =3D true, 

&nb= sp; takenDuringRecovery =3D false, copied =3D true, curcid =3D 14, = speculativeToken =3D 2139062143, active_count =3D 0, regd_count =3D 1, = ph_node =3D {first_child =3D = 0x0, 

&nb= sp;   next_sibling =3D 0xf65ca0 <CatalogSnapshotData+64>, = prev_or_parent =3D 0x2f8dbc8}, whenTaken =3D 0, lsn =3D = 0}

(gd= b) p TransactionXmin

$3 = =3D 196992

(gd= b) f 3

#3&= nbsp; 0x0000000000563111 in SubTransGetTopmostTransaction = (xid=3D196963)

&nb= sp;   at = /home/liupc/build/build_postgres2/../../devel/postgres2/src/backend/acces= s/transam/subtrans.c:325

325=             =  Assert(TransactionIdFollowsOrEquals(xid, = TransactionXmin));

(gd= b) p xid

$4 = =3D 196963

(gd= b) p TransactionXmin

$5 = =3D 196992

```=

 

Aft= er simple analyze, I think it should be a = bug.

 

1, = Main process first get active snapshot(xmin 196962, xmax 210314), and = push active snapshot. 

2, = Main process call InitializeParallelDSM, get transaction snapshot(xmin = 196992, xmax 210320), and send this snapshot with parameters = PARALLEL_KEY_TRANSACTION_SNAPSHOT.

3, = Main process call = ExecParallelInitializeDSM->ExecSeqScanInitializeDSM->table_parallel= scan_initialize  SerializeSnapshot active snapshot(xmin 196962, = xmax 210314)

4, = Main process Lanch Parallel Workers = process.

 

Par= allel Workers process work flow:

1, = ParallelWorkerMain->BackgroundWorkerInitializeConnectionByOid->GetT= ransactionSnapshot(xmin 196992, xmax 210320) and set TransactionXmin to = 196992.

2, = ParallelWorkerMain->RestoreTransactionSnapshot->SetTransactionSnaps= hot->ProcArrayInstallRestoredXmin and set TransactionXmin to = 196992.

3, = ParallelWorkerMain->ExecParallelInitializeWorker->ExecSeqScanInitia= lizeWorker->table_beginscan_parallel restore active snapshot(xmin = 196962, xmax 210314) from main = process.

4, = Got coredump = ParallelWorkerMain->ParallelQueryMain->ExecutorRun...ExecScan->h= eapgetpage->HeapTupleSatisfiesMVCC->XidInMVCCSnapshot->SubTransG= etTopmostTransaction 

 

So = the root cause is the Parallel Workers process set the TransactionXmin = with later transcation snapshot. When parallel scan, Parallel Workers = process use the older active = snapshot.

It = leads to subtrans assert coredump. I don't know how to fix it. Is there = any ideas?

 

Thanks

Pengcheng

<= /div>

 

 

 

------=_NextPart_000_000A_01D74334.BAD3EBD0--