Re:Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

From: 刘鹏程 <pengchengliu(at)tju(dot)edu(dot)cn>
To: Greg Nancarrow <gregn4422(at)gmail(dot)com>
Cc: Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re:Re: Parallel scan with SubTransGetTopmostTransaction assert coredump
Date: 2021-05-15 02:37:29
Message-ID: AMkAGwA2DuDLiuCUBBPk1KoS.3.1621046249310.Hmail.2008202116@tju.edu.cn
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Greg,
It is really weird. Could you make sure is the SnapShot overflow in you ENV? It is very impoint.
Abount SnapShot overflow and Subtrans, you can refer this https://www.cybertec-postgresql.com/en/subtransactions-and-performance-in-postgresql/.

In the script sub_120.sql, for one transaction, we use 120 transcations. So this pgxact->overflowed will be set to true.
Then snapshot must be overflow. When MVCC, it will call SubTransGetTopmostTransaction.
So the snapshot overflow is requirement.

Even though there is no coredump in you ENV, from the codes, we can find some clue.

First, in main process , ActiveSnapshot xmin is very likely preceds TransactionSnapShot xmin.
Second, in parallel work process, it sets TransactionXmin with TransactionSnapShot from main process. But table Scan with ative Snapshot from main process.
So in parallel work process SubTransGetTopmostTransaction, the Assert TransactionIdFollowsOrEquals(xid, TransactionXmin) is not correct.
At least this assert is unsuitable for parallel work process.
For my analyze, if there is any incorrect, please corret me.

BTW, I test it in a high performance server. It is verly easily be reproduced. My colleague and me use different environment both can reproduce it.


Thanks
Pengcheng

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2021-05-15 05:14:11 Re: Added missing tab completion for alter subscription set option
Previous Message Michael Paquier 2021-05-15 02:26:22 Rewriting the test of pg_upgrade as a TAP test - take three - remastered set