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

Re: xlog.c: WALInsertLock vs. WALWriteLock

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, fazool mein <fazoolmein(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: xlog.c: WALInsertLock vs. WALWriteLock
Date: 2010-10-26 15:52:38
Message-ID: 1288108305-sup-6886@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Excerpts from Jeff Janes's message of mar oct 26 12:22:38 -0300 2010:

> I don't think that holding WALWriteLock accomplishes much.  It
> prevents part of the buffer from being written out to OS/disk, and
> thus becoming eligible for being overwritten in the buffer, but the
> WALInsertLock prevents it from actually being overwritten.  And what
> if the part of the buffer you want to read was already eligible for
> overwriting but not yet actually overwritten?  WALWriteLock won't
> allow you to safely access it, but WALInsertLock will (assuming you
> have a safe way to identify the record in the first place).  For
> either case, holding it in shared mode would be sufficient.

And horrible for performance, I imagine.  Those locks are highly trafficked.

-- 
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

pgsql-hackers by date

Next:From: David E. WheelerDate: 2010-10-26 16:04:17
Subject: Re: add label to enum syntax
Previous:From: Merlin MoncureDate: 2010-10-26 15:41:59
Subject: Re: Postgres insert performance and storage requirement compared to Oracle

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