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

Re: FlexLocks

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: simon(at)2ndquadrant(dot)com, alvherre(at)commandprompt(dot)com, pgsql-hackers(at)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: FlexLocks
Date: 2011-12-15 19:02:59
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Fri, Dec 2, 2011 at 4:11 PM, Kevin Grittner
<Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
> As far as I'm concerned it looks great and "Ready for Committer"
> except for the modularity/pluggability question.  Perhaps that could
> be done as a follow-on patch (if deemed a good idea)?

I investigated the performance issues with the previous version of the
patch and found that turning some of the FlexLock support functions
into macros seems to help quite a bit, so I've done that in the
attached versions.  I've also incorporated Kevin's incremental patch
from his previous version.

That having been said, I'm leaning away from applying any of this for
the time being.  For one thing, Pavan's PGXACT stuff has greatly
eroded the benefit of this patch.  I'm fairly optimistic about the
prospects of finding other good uses for the FlexLock machinery down
the road, but I don't feel like that's enough reason to apply it now.
Also, there are several other good ideas kicking around out there for
further reducing ProcArrayLock contention, some of which are
lower-impact than this and others of which would obsolete the entire
approach.  So it seems like I should probably let the dust settle on
those things before deciding whether this even makes sense.  In
particular, I'm starting to think that resolving the contention
between GetSnapshotData() and ProcArrayEndTransaction() is basically a
layup at this point, and I really want to go for a three-pointer,
namely also eliminating the spinlock contention between different
backends all trying to acquire ProcArrayLock in shared mode during
read-only operation.

So, I'm going to mark this Returned with Feedback for now and keep
working on the problem.  Thanks for the review and positive comments.

Robert Haas
The Enterprise PostgreSQL Company

Attachment: flexlock-v4.patch
Description: application/octet-stream (70.0 KB)
Attachment: procarraylock-v3.patch
Description: application/octet-stream (33.8 KB)

In response to

pgsql-hackers by date

Next:From: Heikki LinnakangasDate: 2011-12-15 19:06:08
Subject: Re: Moving more work outside WALInsertLock
Previous:From: Tomas VondraDate: 2011-12-15 18:55:52
Subject: Re: pgstat wait timeout

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