Re: BUG #17116: Assert failed in SerialSetActiveSerXmin() on commit of parallelized serializable transaction

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2021-07-29T21:41:33Z
Lists: pgsql-bugs
On Wed, Jul 28, 2021 at 5:02 PM Thomas Munro <thomas.munro@gmail.com> wrote:
> On Wed, Jul 28, 2021 at 9:00 AM Alexander Lakhin <exclusion@gmail.com> wrote:
> > (Except for read-only-anomaly-3, that causes another
> > assertion fail but I believe that it's not related to the initial issue
> > and deserves another bug report.)
>
> Huh.  I tried and failed to find that one with concurrent runs.  I'll
> wait for your next report before I do anything, just in case there's a
> connection.

This is indeed an unrelated issue, and much older.  After many
kilowatt hours, I reproduced it here and worked out that it comes from
GetSafeSnapshot() not expecting possibleUnsafeConflicts to be empty
when WritableSxactCount == 0.  More soon.



Commits

  1. Fix race in SERIALIZABLE READ ONLY.

  2. Fix assert failures in parallel SERIALIZABLE READ ONLY.

  3. Fix SxactGlobalXmin tracking.

  4. There's a small window wherein a transaction is committed but not yet