Re: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump
Greg Nancarrow <gregn4422@gmail.com>
From: Greg Nancarrow <gregn4422@gmail.com>
To: Pengchengliu <pengchengliu@tju.edu.cn>
Cc: Andres Freund <andres@anarazel.de>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-05-20T06:08:36Z
Lists: pgsql-hackers
Attachments
- v1-0001-PG14-Fix-parallel-worker-failed-assertion-and-coredump.patch (application/octet-stream) patch v1-0001
- v1-0001-PG13_2-Fix-parallel-worker-failed-assertion-and-coredump.patch (application/octet-stream) patch v1-0001
On Thu, May 20, 2021 at 11:18 AM Pengchengliu <pengchengliu@tju.edu.cn> wrote: > > Hi Greg, > Thanks a lot for you explanation and your fix. > > I think your fix can resolve the core dump issue. As with your fix, parallel process reset Transaction Xmin from ActiveSnapshot. > But it will change Transaction snapshot for all parallel scenarios. I don't know whether it bring in other issue. > For test only, I think it is enough. > > So is there anybody can explain what's exactly difference between ActiveSnapshot and TransactionSnapshot in parallel work process. > Then maybe we can find a better solution and try to fix it really. > I am proposing the attached patch to fix this issue (patches for both PG13.2 and latest PG14 source are provided). Perhaps this will trigger others who better know the intricacies of snapshot handling, and know the reasons and history behind why the transaction_snapshot and active_snapshot are currently passed separately to parallel workers, to speak up here and discuss the issue further, and check my fix (and note, I haven't attempted to modify README.parallel in the patch until I get further clarification on this issue). Perhaps someone can explain the purpose of calling GetTransactionSnapshot() AGAIN in InitializeParallelDSM() and how is this consistent with the current ActiveSnapshot? AFAICS, that doesn't seem correct, and that's why the patch removes it. I've rebuilt Postgres with the patch applied and run the regression tests, with and without "force_parallel_mode=regress", and all tests pass. So if the fix is wrong, no tests currently exist that detect issues with it. Regards, Greg Nancarrow Fujitsu Australia
Commits
-
Fix broken snapshot handling in parallel workers.
- 96f6ef9fe451 10.19 landed
- 198cf81e2c64 11.14 landed
- f4b77e82ebf4 12.9 landed
- bc062cb93823 13.5 landed
- 11c1239881b3 14.0 landed
- a780b2fcce6c 15.0 landed
-
Doc: move some catalogs.sgml entries to the right place.
- 713a431c781f 14.0 cited
-
Stamp 13.2.
- 3fb4c75e857a 13.2 cited
-
Create an infrastructure for parallel computation in PostgreSQL.
- 924bcf4f16d5 9.5.0 cited