Re: remove lock protection on HeapTupleSatisfiesVacuum - Mailing list pgsql-patches

From Tom Lane
Subject Re: remove lock protection on HeapTupleSatisfiesVacuum
Date
Msg-id 9878.1149564115@sss.pgh.pa.us
Whole thread Raw
In response to remove lock protection on HeapTupleSatisfiesVacuum  (Qingqing Zhou <zhouqq@cs.toronto.edu>)
List pgsql-patches
Qingqing Zhou <zhouqq@cs.toronto.edu> writes:
> Attached is a patch to remove the lock protection for
> HeapTupleSatisfiesVacuum() in index code.

This patch scares the heck out of me.  You need to offer some pretty
compelling performance reasons before I'd accept any part of it,
most especially this:

*** bufmgr.c    14 Apr 2006 03:38:55 -0000    1.207
--- bufmgr.c    6 Jun 2006 02:07:09 -0000
***************
*** 1686,1693 ****
      bufHdr = &BufferDescriptors[buffer - 1];

      Assert(PrivateRefCount[buffer - 1] > 0);
-     /* here, either share or exclusive lock is OK */
-     Assert(LWLockHeldByMe(bufHdr->content_lock));

      /*
       * This routine might get called many times on the same page, if we are
--- 1686,1691 ----

Changing a buffer you hold no lock on is a recipe for disaster.

Where is the performance-boost evidence that suggests we should
even take the time to analyze whether this is safe?

            regards, tom lane

pgsql-patches by date:

Previous
From: Qingqing Zhou
Date:
Subject: remove lock protection on HeapTupleSatisfiesVacuum
Next
From: "Qingqing Zhou"
Date:
Subject: Re: remove lock protection on HeapTupleSatisfiesVacuum