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-27T11:17:00Z
Lists: pgsql-bugs

Attachments

On Tue, Jul 27, 2021 at 8:00 AM Alexander Lakhin <exclusion@gmail.com> wrote:
> Thanks! I'm not sure, whether this is related to the fix, but my
> parallel installcheck script (attached) catches another assert with the
> patch applied:

> #2  0x000055b16d72aa32 in ExceptionalCondition (
>     conditionName=conditionName@entry=0x55b16d89ccd0
> "!SxactIsPartiallyReleased(MySerializableXact)",
>     errorType=errorType@entry=0x55b16d78301d "FailedAssertion",
> fileName=fileName@entry=0x55b16d89bbc9 "predicate.c",
>     lineNumber=lineNumber@entry=4859) at assert.c:67

Reproduced here using a similar approach.  It doesn't fail with this
new draft patch.  The main thing I have learned is that
serializable-parallel-2.sql isn't really testing a very interesting
code path.  I'll try to come up with a better test.

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