From: Bruce Momjian <bruce@momjian.us>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: Sergey Burladyan <eshkinkot@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Cc: Dmitriy Sarafannikov <dsarafannikov@yandex.ru>
Cc: Vladimir Borodin <root@simply.name>
Subject: Re: Broken hint bits (freeze)
Date: Wed, 28 Jun 2017 21:24:46 -0400
Message-ID: <20170629012446.GA16576@momjian.us> (raw)
In-Reply-To: <CAA4eK1KB-M3mzxBNuNmpbOEq_6yPK6mT8=m80V+wRJGqSozYDg@mail.gmail.com>
References: <20170620025919.GA28277@momjian.us>
<20170620033726.GB28277@momjian.us>
<87h8zb6kbx.fsf@seb.koffice.internal>
<CAA4eK1JmEAj9qUMbS-=u7b4Boqsr3mAoadevT9LDWm4JgxamBg@mail.gmail.com>
<8760fq7pfe.fsf@seb.koffice.internal>
<CAA4eK1JxV1+UTyU3T2WM6rhiDEZy6zk3cx+Y3TaXCXAwQxcU1Q@mail.gmail.com>
<CAA4eK1+o6ErVAh484VtE91wow1-uOysohSvb0TS52Ei76PzOKg@mail.gmail.com>
<20170621163356.GB9358@momjian.us>
<87lgoi68dg.fsf@seb.koffice.internal>
<CAA4eK1KB-M3mzxBNuNmpbOEq_6yPK6mT8=m80V+wRJGqSozYDg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On Sat, Jun 24, 2017 at 09:19:10AM +0530, Amit Kapila wrote:
> > I successfully upgraded last night from 9.2 to 9.4 and find other issue :-)
> >
> > It is about hash index and promote:
> > 1. create master
> > 2. create standby from it
> > 3. create unlogged table and hash index like:
> > create unlogged table test (id int primary key, v text);
> > create index on test using hash (id);
> > 3. stop master
> > 4. promote standby
> >
> > now, if you try to upgrade this new promoted master pg_upgrade will stop
> > on this hash index:
> > error while creating link for relation "public.test_id_idx" ("s/9.2/base/16384/16393" to "m/9.4/base/16422/16393"): No such file or directory
> > Failure, exiting
> >
>
> I am not sure if this is a problem because in the version you are
> trying hash indexes are not WAL-logged and the creation of same will
> not be replicated on standby, so the error seems to be expected.
Well, it certainly should not error out like this. I have not seen such
a failure report before.
I think the fundamental problem is that unlogged objects
(pg_class.relpersistence='u') creates a file on the master, but doesn't
create anything on the standby since it is never transmitted over the
WAL (assuming the object is created after the base backup).
I assume the standby creates them as empty when it is promoted to
primary and someone tries to access the object. I wonder if I need to
add a boolean to each object to record if it is unlogged, and allow
copy/link to silently fail in such cases. Does that make sense?
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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: bruce@momjian.us, amit.kapila16@gmail.com, eshkinkot@gmail.com, dsarafannikov@yandex.ru, root@simply.name
Subject: Re: Broken hint bits (freeze)
In-Reply-To: <20170629012446.GA16576@momjian.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