pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Tom Lane <tgl@sss.pgh.pa.us>
To: Martijn van Oosterhout <kleptog@svana.org>
Cc: Andres Freund <andres@anarazel.de>
Cc: Fujii Masao <masao.fujii@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: WAL logging problem in 9.4.3?
Date: Fri, 03 Jul 2015 16:05:17 -0400
Message-ID: <15205.1435953917@sss.pgh.pa.us> (raw )
In-Reply-To: <20150703195736.GB2841@svana.org >
References: <20150702222102.GG30708@awork2.anarazel.de >
<20150703052048.GA20285@svana.org >
<CAHGQGwEXta1tMF6o-FcDcjMgCF=jnZLj3v3EoePvsEN4aexJnA@mail.gmail.com >
<20150703060137.GB20285@svana.org >
<CAHGQGwFtOMv5h8eKX6zf+9_0UxpcTsyH9xAnyv6KdGH4BonLiw@mail.gmail.com >
<28320.1435935120@sss.pgh.pa.us >
<CAHGQGwGzxAyKLUm+z2n43-ee6u976jLmQAz=pPBVzSueD3CAig@mail.gmail.com >
<10146.1435942436@sss.pgh.pa.us >
<20150703171426.GA2841@svana.org >
<20150703172121.GL3291@awork2.anarazel.de >
<20150703195736.GB2841@svana.org >
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Martijn van Oosterhout <kleptog@svana.org> writes:
> With inserts the WAL records look as follows (relfilenodes changed):
> ...
> And amazingly, the database cluster successfuly recovers and there's no
> error now. So the problem is *only* because there is no data in the
> table at commit time. Which indicates that it's the 'newroot" record
> that saves the day normally. And it's apparently generated by the
> first insert.
Yeah, because the correct "empty" state of a btree index is to have a
metapage but no root page, so the first insert forces creation of a root
page. And, by chance, btree_xlog_newroot restores the metapage from
scratch, so this works even if the metapage had been missing or corrupt.
However, things would still break if the first access to the index was
a read attempt rather than an insert.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
view thread (244+ messages) latest in thread
Message-ID: <15205.1435953917@sss.pgh.pa.us>
Permalink: ../15205.1435953917@sss.pgh.pa.us/
Also on: postgresql.org/message-id/15205.1435953917@sss.pgh.pa.us
copy link · copy postgr.es
reply 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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, kleptog@svana.org, andres@anarazel.de, masao.fujii@gmail.com
Subject: Re: WAL logging problem in 9.4.3?
In-Reply-To: <15205.1435953917@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