From: Tom Lane <tgl@sss.pgh.pa.us>
To: Kevin Grittner <kgrittn@postgresql.org>
Cc: pgsql-committers@postgresql.org
Subject: Re: pgsql: Add the "snapshot too old" feature
Date: Sun, 10 Apr 2016 11:06:42 -0400
Message-ID: <17585.1460300802@sss.pgh.pa.us> (raw)
In-Reply-To: <E1aocLh-0006C7-2W@gemulon.postgresql.org>
References: <E1aocLh-0006C7-2W@gemulon.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>
Kevin Grittner <kgrittn@postgresql.org> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, kgrittn@postgresql.org
Subject: Re: pgsql: Add the "snapshot too old" feature
In-Reply-To: <17585.1460300802@sss.pgh.pa.us>
References: <E1aocLh-0006C7-2W@gemulon.postgresql.org> <17585.1460300802@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox