Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TgNNJ-0007ib-Cl for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Dec 2012 22:23:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1TgNNH-0001Uy-Sp for pgsql-bugs@arkaria.postgresql.org; Wed, 05 Dec 2012 22:23:27 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TgNN5-0001KA-AA for pgsql-bugs@postgresql.org; Wed, 05 Dec 2012 22:23:15 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TgNN3-0001xI-GV for pgsql-bugs@postgresql.org; Wed, 05 Dec 2012 22:23:14 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id qB5MN8mv015789; Wed, 5 Dec 2012 17:23:08 -0500 (EST) From: Tom Lane To: Robert Haas cc: Simon Riggs , Andres Freund , Jeff Janes , Heikki Linnakangas , Noah Misch , Pg Bugs Subject: Re: PITR potentially broken in 9.2 In-reply-to: References: <20121205021537.GB9811@awork2.anarazel.de> <22653.1354674454@sss.pgh.pa.us> <20121205143314.GA6420@awork2.anarazel.de> <6461.1354723883@sss.pgh.pa.us> <20121205162421.GB20456@awork2.anarazel.de> <7015.1354725616@sss.pgh.pa.us> <20121205173025.GD27424@awork2.anarazel.de> <8223.1354728999@sss.pgh.pa.us> <9918.1354733333@sss.pgh.pa.us> <12846.1354742138@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Wed, 05 Dec 2012 17:10:43 -0500" Date: Wed, 05 Dec 2012 17:23:08 -0500 Message-ID: <15788.1354746188@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Robert Haas writes: > On Wed, Dec 5, 2012 at 4:15 PM, Tom Lane wrote: >> The argument for this is that although we might fetch a slightly stale >> value of the shared variable, it can't be very stale --- certainly no >> older than the spinlock acquisition near the bottom of the previous >> iteration of the loop. And this is a highly asynchronous feature >> anyhow, so fuzziness of plus or minus one WAL record in when the pause >> gets honored is not going to be detectable. Hence an extra spinlock >> acquisition is not worth the cost. > I wonder whether the cost of an extra spinlock acquire/release cycle > is really noticeable here. That can get expensive in a hurry when > lots of processes are contending the spinlock ... but I think that > shouldn't be the case here; most of the accesses will be coming from > the startup process. Of course atomic operations are much more > expensive than ordinary CPU instructions even under the best of > circumstances, but is that really material here? I'm just wondering > whether this is premature optimization that's going to potentially > bite us later in the form of subtle, hard-to-reproduce bugs. I have the same doubt about whether it's really significant. However, I think it's much more likely that we'd find out it is significant than that we'd find out anybody could detect the lack of a memory barrier there. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs