Re: BUG #17072: Assert for clogGroupNext failed due to a race condition in TransactionGroupUpdateXidStatus()
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Alexander Lakhin <exclusion@gmail.com>, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2021-06-25T09:55:13Z
Lists: pgsql-bugs
On Fri, Jun 25, 2021 at 12:20 AM PG Bug reporting form <noreply@postgresql.org> wrote: > > The offending (the one that leaved a "valid" clogGroupNext) proccess is > 60d48c2d.ea21. It looks like it got from the > pg_atomic_compare_exchange_u32() the nextidx value that was written in the > clogGroupFirst by the process 60d48c2e.ebc5, and exited just after that. > Your analysis seems to be in the right direction. Can you try by setting clogGroupNext to INVALID_PGPROCNO (pg_atomic_write_u32(&proc->clogGroupNext, INVALID_PGPROCNO);) before we return false in the first while(true) loop in function TransactionGroupUpdateXidStatus()? I think this should be reproducible on all branches from HEAD till v11. Have you tried in any other branch? I'll also try to reproduce it. -- With Regards, Amit Kapila.
Commits
-
Fix race condition in TransactionGroupUpdateXidStatus().
- b786304c2904 14.0 landed
- b75c1f6879c5 12.8 landed
- c62c3769ff61 11.13 landed
- 741deb2603c7 13.4 landed