Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1apGwq-0001cj-M2 for pgsql-committers@arkaria.postgresql.org; Sun, 10 Apr 2016 15:06:48 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1apGwp-0003kX-0o for pgsql-committers@arkaria.postgresql.org; Sun, 10 Apr 2016 15:06:47 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1apGwo-0003kR-LN for pgsql-committers@postgresql.org; Sun, 10 Apr 2016 15:06:46 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1apGwl-0008LJ-0Z; Sun, 10 Apr 2016 15:06:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u3AF6gZX017586; Sun, 10 Apr 2016 11:06:42 -0400 From: Tom Lane To: Kevin Grittner cc: pgsql-committers@postgresql.org Subject: Re: pgsql: Add the "snapshot too old" feature In-reply-to: References: Comments: In-reply-to Kevin Grittner message dated "Fri, 08 Apr 2016 19:45:45 -0000" Date: Sun, 10 Apr 2016 11:06:42 -0400 Message-ID: <17585.1460300802@sss.pgh.pa.us> X-Pg-Spam-Score: -2.9 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org Kevin Grittner writes: > Add the "snapshot too old" feature I am fairly certain that this: typedef struct OldSnapshotControlData *OldSnapshotControl; static volatile OldSnapshotControl oldSnapshotControl; does not do what you intended. That causes the pointer variable to be marked volatile, not what it points to. You need to write static volatile OldSnapshotControlData *oldSnapshotControl; to cause oldSnapshotControl to be understood as a pointer to something volatile. I think you could lose the OldSnapshotControl typedef altogether; it's practically unused, it's confusingly similar to the name of the pointer variable, and if anyplace did use it (eg to declare a local-variable copy of oldSnapshotControl) it would be wrong because of the same misplacement of the volatile property as here. It's possible that you could instead fix this by putting the volatile marker inside the typedef, but I'm not enough of a C language lawyer to be sure that that works in the way you need; and since we don't rely on such a thing anyplace else, I would be hesitant to start here. regards, tom lane -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers