Skip site navigation (1) Skip section navigation (2)

SSI atomic commit

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: SSI atomic commit
Date: 2011-07-05 17:03:52
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
In reviewing the 2PC changes mentioned in a separate post, both Dan
and I realized that these were dependent on the assumption that
SSI's commitSeqNo is assigned in the order in which the transactions
became visible.  There is a race condition such that this is not
necessarily true.  It is a very narrow race condition, which would
come up very rarely in practice, but Murphy's Law being what it is,
I think we need to consider it a bug and fix it.
We considered a fix which would be contained within predicate.c code
and operate by making pessimistic assumptions, so that no false
negatives occurred.  The reason we didn't go that way is that the
code would be very convoluted and fragile.  The attached patch just
makes it atomic in a very direct way, and adjusts the predicate.c
code to use the right tests in the right places.  We were careful
not to add any LW locking to the path that a normal transaction
without an XID is terminating, since there had obviously been
significant work put into keeping locks out of that code path.
Dan and I collaborated on this code over the holiday weekend, and
are in agreement that this is the right route.  I know it's only six
days before beta3, but I'm hopeful that someone can review this for
commit in time to make it into that beta.
This patch applies over the top of the fix for the 2PC permutation
I apologize for having found this bug so late in the release cycle.

Attachment: ssi-atomic-commit.patch
Description: text/plain (19.3 KB)


pgsql-hackers by date

Next:From: Robert HaasDate: 2011-07-05 17:06:22
Subject: Re: Range Types, constructors, and the type system
Previous:From: Jeff DavisDate: 2011-07-05 16:54:34
Subject: Re: Range Types, constructors, and the type system

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group