From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@postgresql.org>
Subject: Re: SIGQUIT and lost sequence WAL records
Date: Wed, 17 Feb 2016 09:54:30 -0500
Message-ID: <15747.1455720870@sss.pgh.pa.us> (raw)
In-Reply-To: <CAB7nPqQ6+0LNkitj507eDBMh-OBdm_1_X-LmLOQfsjiWXe9SvA@mail.gmail.com>
References: <CAB7nPqQ6+0LNkitj507eDBMh-OBdm_1_X-LmLOQfsjiWXe9SvA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Michael Paquier <michael.paquier@gmail.com> writes:
> Lately a couple of colleagues have pinged me regarding the fact that a
> server signaled with SIGQUIT, or "pg_ctl stop -m immediate", may
> ignore sequence WAL records.
I've not gone through this in detail, but I think what is happening
is that since the test case never commits any transactions, the
sequence-advance WAL records may not get flushed to disk, and thus
of course are not available for replay. This is not a bug IMO, as
by the exact same token, no uses of those nextval() values can appear
in any committed tuples, so no database inconsistency is possible.
If an application is using nextval() results *externally to the
database*, it's unsafe for it to rely on those values being unique
unless/until it commits the nextval() calls.
I seem to recall some past discussions about whether a transaction
that commits after writing only a sequence advance (that is, it
did nextval() and nothing else) needs to flush WAL. I think at one
point it did not but we changed it because of this consideration.
[ digs around... ] That was a long time ago: see 01747692f.
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
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, michael.paquier@gmail.com
Subject: Re: SIGQUIT and lost sequence WAL records
In-Reply-To: <15747.1455720870@sss.pgh.pa.us>
References: <CAB7nPqQ6+0LNkitj507eDBMh-OBdm_1_X-LmLOQfsjiWXe9SvA@mail.gmail.com> <15747.1455720870@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