Re: subtransaction assert failure

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
Subject: Re: subtransaction assert failure
Date: 2004-09-16 15:43:17
Message-ID: 21559.1095349397@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Neil Conway <neilc(at)samurai(dot)com> writes:
> I'm seeing an intermittent assertion failure while running "make check"
> with current sources.

> TRAP: FailedAssertion("!(TransactionIdFollowsOrEquals(xid,
> RecentXmin))", File:
> "/Users/neilc/pgsql/src/backend/access/transam/subtrans.c", Line: 146)

Hmm, I haven't seen this myself but I see what's causing it --- sloppy
thinking about the role of RecentXmin. We need another variable named
something like TransactionXmin, which would be the RecentXmin first
computed during the current transaction. (This would be a copy of
MyProc->xmin; we could just look directly at that but I think I prefer
a separate backend-local variable.) The tests that protect access to
pg_subtrans need to use this, not RecentXmin, as the cutoff point.

The problem of course is that RecentXmin is the xmin associated with the
most recently computed snapshot, but there may be older snapshots still
in use in the transaction. The time qual test code needs to be able to
get answers for transactions that could be present in any of the
transaction's snapshots, not only the most recent.

Mea culpa, will fix.

regards, tom lane

PS: this points up once again that the regression tests do not do very
well at testing concurrent behavior. We need to think about some sort
of parallel-test harness that would let us write tests that have better
odds of catching bugs like this.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-09-16 17:56:34 Re: pg_dump --exclude-schema=foo
Previous Message Andrew Dunstan 2004-09-16 14:57:16 Re: subtransaction assert failure