From: Andres Freund <andres@2ndquadrant.com>
To: Vik Fearing <vik.fearing@dalibo.com>
Cc: MauMau <maumau307@gmail.com>
Cc: Pavan Deolasee <pavan.deolasee@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: maxim.boguk <maxim.boguk@gmail.com>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #10675: alter database set tablespace and unlogged table
Date: Wed, 13 Aug 2014 19:11:11 +0200
Message-ID: <20140813171111.GG14949@awork2.anarazel.de> (raw)
In-Reply-To: <53EB95C9.1020004@dalibo.com>
References: <20140618110240.GJ3115@awork2.anarazel.de>
<11621.1403099146@sss.pgh.pa.us>
<20140618141949.GC3968@awork2.anarazel.de>
<CABOikdNMWyfvcm+1Ks-VVRzRDyKsEZj5Ehb3C2+-MYBYftcs+w@mail.gmail.com>
<CABOikdN=3B7zXfOnPTjDzRu6SsuDJsYGE14cu7t2NRv3CffdVw@mail.gmail.com>
<246F964E3CEB4B8D85FC5876CA37CC36@maumau>
<20140813130720.GC28982@awork2.anarazel.de>
<149312E3EED04551A6E5F394AF029DF2@maumau>
<20140813143258.GD28982@awork2.anarazel.de>
<53EB95C9.1020004@dalibo.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
On 2014-08-13 18:43:53 +0200, Vik Fearing wrote:
> There is also this issue which has been bugging me for a while but I
> haven't had time to look at providing a patch for:
>
> postgres=# create unlogged table t (id integer);
> CREATE TABLE
> postgres=# insert into t values (1);
> INSERT 0 1
> postgres=# create index on t using hash (id);
> CREATE INDEX
>
> <crash and restart server here>
>
> postgres=# set enable_seqscan = off;
> SET
> postgres=# select * from t where id = 1;
> ERROR: index "t_id_idx" contains unexpected zero page at block 0
> HINT: Please REINDEX it.
>
> All because the init fork is never checkpointed to disk. If there's
> anywhere a hash index should be safe to use, it's on unlogged tables.
I don't think this really is related. For one, this this surely can't be
fixed with anything checkpoint related. The overhead of that would be
prohibitive.
Other *builempty routines use smgrimmedsync(), but hash doesn't. That's
the problem here. Note that that still won't make it safe across
streaming rep et al....
Greetings,
Andres Freund
--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
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: andres@2ndquadrant.com, vik.fearing@dalibo.com, maumau307@gmail.com, pavan.deolasee@gmail.com, tgl@sss.pgh.pa.us, maxim.boguk@gmail.com
Subject: Re: BUG #10675: alter database set tablespace and unlogged table
In-Reply-To: <20140813171111.GG14949@awork2.anarazel.de>
References: <20140618110240.GJ3115@awork2.anarazel.de> <11621.1403099146@sss.pgh.pa.us> <20140618141949.GC3968@awork2.anarazel.de> <CABOikdNMWyfvcm+1Ks-VVRzRDyKsEZj5Ehb3C2+-MYBYftcs+w@mail.gmail.com> <CABOikdN=3B7zXfOnPTjDzRu6SsuDJsYGE14cu7t2NRv3CffdVw@mail.gmail.com> <246F964E3CEB4B8D85FC5876CA37CC36@maumau> <20140813130720.GC28982@awork2.anarazel.de> <149312E3EED04551A6E5F394AF029DF2@maumau> <20140813143258.GD28982@awork2.anarazel.de> <53EB95C9.1020004@dalibo.com> <20140813171111.GG14949@awork2.anarazel.de>
* 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