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

Re: What's left?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>,Claudio Natoli <claudio(dot)natoli(at)memetrics(dot)com>,"''Merlin Moncure' '" <merlin(dot)moncure(at)rcsonline(dot)com>,"'pgsql-hackers-win32 '" <pgsql-hackers-win32(at)postgresql(dot)org>
Subject: Re: What's left?
Date: 2004-01-27 01:53:02
Message-ID: 200401270153.i0R1r2w21730@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-hackers-win32pgsql-patches
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > In this way, no one ever has the rename file open while we are holding
> > the locks, and we can loop without holding an exclusive lock on
> > pg_shadow, and file writes remain in order.
> 
> You're doing this where exactly, and are certain that you are holding no
> locks why exactly?  And if you aren't holding a lock, what prevents
> concurrency bugs?

Oh, for concurrency bugs, you make realfile.new while holding the
exclusive lock, so someone could come in later and replace realfile.new
while I am in the rename loop, but then I just install theirs instead.

I could install someone who has just done the rename to realfile.new but
not tried the rename from realfile.new to realfile, but that seems OK. 
They will just fine the file missing and fail on the rename, which is
OK.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2004-01-27 02:42:14
Subject: Re: Extending SET SESSION AUTHORIZATION
Previous:From: Bruce MomjianDate: 2004-01-27 01:51:12
Subject: Re: [pgsql-hackers-win32] What's left?

pgsql-patches by date

Next:From: Bruce MomjianDate: 2004-01-27 04:01:43
Subject: Re: [HACKERS] What's left?
Previous:From: Bruce MomjianDate: 2004-01-27 01:51:12
Subject: Re: [pgsql-hackers-win32] What's left?

pgsql-hackers-win32 by date

Next:From: Bruce MomjianDate: 2004-01-27 04:01:43
Subject: Re: [HACKERS] What's left?
Previous:From: Bruce MomjianDate: 2004-01-27 01:51:12
Subject: Re: [pgsql-hackers-win32] What's left?

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