pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dan Ports <drkp@csail.mit.edu>
To: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: SSI atomic commit
Date: Tue, 5 Jul 2011 15:54:36 -0400
Message-ID: <20110705195436.GB94047@csail.mit.edu> (raw)
In-Reply-To: <4E130E61020000250003EFD8@gw.wicourts.gov>
References: <4E12FDA8020000250003EFC1@gw.wicourts.gov>
	<4E13516F.50301@enterprisedb.com>
	<4E130E61020000250003EFD8@gw.wicourts.gov>

On Tue, Jul 05, 2011 at 01:15:13PM -0500, Kevin Grittner wrote:
> Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> wrote:
>  
> > Hmm, I think it would be simpler to decide that instead of 
> > SerializableXactHashLock, you must hold ProcArrayLock to access 
> > LastSxactCommitSeqNo, and move the assignment of commitSeqNo to 
> > ProcArrayTransaction(). It's probably easiest to move 
> > LastSxactCommitSeqno to ShmemVariableCache too. There's a few
> > places that would then need to acquire ProcArrayLock to read 
> > LastSxactCommitSeqno, but I feel it might still be much simpler
> > that way.
>  
> We considered that.  I think the biggest problem was that when there
> is no XID it wouldn't be covered by the lock on assignment.

One other issue is that after the sequence number is assigned, it still
needs to be stored in MySerializableXact->commitSeqNo. Modifying that
does require taking SerializableXactHashLock.

With the proposed patch, assigning the next commitSeqNo and storing it
in MySerializableXact happen atomically. That makes it possible to say
that a transaction that has a commitSeqNo must have committed before
one that doesn't. If the two steps are separated, that isn't true: two
transactions might get their commitSeqNos in one order and make them
visible in the other. We should be able to deal with that, but it will
make some of the commit ordering checks more complicated.

Dan

-- 
Dan R. K. Ports              MIT CSAIL                http://drkp.net/



view thread (26+ messages)  latest in thread

Message-ID: <20110705195436.GB94047@csail.mit.edu>
Permalink:  ../20110705195436.GB94047@csail.mit.edu/
Also on:    postgresql.org/message-id/20110705195436.GB94047@csail.mit.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: drkp@csail.mit.edu, Kevin.Grittner@wicourts.gov, heikki.linnakangas@enterprisedb.com
  Subject: Re: SSI atomic commit
  In-Reply-To: <20110705195436.GB94047@csail.mit.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox