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

Re: advancing snapshot's xmin

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Neil Conway" <neilc(at)samurai(dot)com>
Cc: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>,"Pg Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: advancing snapshot's xmin
Date: 2008-03-26 00:32:25
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Neil Conway wrote:
> On Tue, 2008-03-25 at 17:26 -0300, Alvaro Herrera wrote:
>> There is one hole here: contention on ProcArrayLock.  Basically, for
>> simple transactions we will need to update MyProc after every command.
> If we're just updating MyProc->xmin, we only need to acquire
> ProcArrayLock in shared mode, right?

In fact, do you need a lock at all? We already assume that 
reading/writing a TransactionId is atomic in many places. We acquire 
ProcArrayLock at the end of transaction when we clear MyProc->xid, to 
ensure that we don't exit the set of running transactions while someone 
else is taking a snapshot, but AFAICS that's not necessary when we just 
advance MyProc->xmin.

   Heikki Linnakangas

In response to


pgsql-hackers by date

Next:From: Bruce MomjianDate: 2008-03-26 00:55:42
Subject: Re: Auto Partitioning Patch - WIP version 1
Previous:From: Tatsuo IshiiDate: 2008-03-26 00:31:45
Subject: Re: PostgreSQL Replication with read-only access to standby DB

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