pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Simon Riggs <simon@2ndQuadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@commandprompt.com>
Cc: Euler Taveira de Oliveira <euler@timbira.com>
Cc: Emanuel <postgres.arg@gmail.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #6041: Unlogged table was created bad in slave node
Date: Tue, 7 Jun 2011 07:57:39 +0100
Message-ID: <BANLkTikMKmpSdBCLR2YS0d-rbJEjg1c-pA@mail.gmail.com> (raw)
In-Reply-To: <BANLkTim433vF5HWjbJ0FSWm_-xA8DDaGNg@mail.gmail.com>
References: <201105261137.p4QBbTlt077425@wwwmaster.postgresql.org>
	<4DDE7905.6050406@timbira.com>
	<1306427067-sup-7622@alvh.no-ip.org>
	<25332.1306427674@sss.pgh.pa.us>
	<BANLkTim433vF5HWjbJ0FSWm_-xA8DDaGNg@mail.gmail.com>

On Wed, Jun 1, 2011 at 7:28 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Thu, May 26, 2011 at 12:34 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Alvaro Herrera <alvherre@commandprompt.com> writes:
>>> Excerpts from Euler Taveira de Oliveira's message of jue may 26 12:00:05 -0400 2011:
>>>> I think we should emit the real cause in those cases, if possible (not too
>>>> much overhead). The message would be "Unlogged table content is not available
>>>> in standby server".
>>
>>> I guess what it should do is create an empty file in the slave.
>>
>> Probably it should, because won't the table malfunction after the slave
>> is promoted to master, if there's no file at all there?  Or will the
>> process of coming live create an empty file even if there was none?
>
> Coming live creates an empty file.
>
>> But Euler is pointing out a different issue, which is usability.  If the
>> slave just acts like the table is present but empty, we are likely to
>> get bug reports about that too.  An error telling you you aren't allowed
>> to access such a table on slaves would be more user-friendly, if we can
>> do it without too much pain.
>
> I looked into this a bit.  A few observations:
>
> (1) This problem is actually not confined to unlogged tables;
> temporary tables have the same issue.  For example, if you create a
> temporary table on the master and then, on the slave, do SELECT * FROM
>  pg_temp_3.hi_mom (or whatever the name of the temp schema where the
> temp table is) you get the same error.  In fact I suspect if you took
> a base backup that included the temporary relation and matched the
> backend ID you could even manage to read out the old contents (modulo
> any fun and exciting XID wraparound issues).  But the problem is of
> course more noticeable for unlogged tables since they're not hidden
> away in a special funny schema.

Seems like you're trying to fix the problem directly, which as you
say, has problems.

At some point we resolve from a word mentioned in the FROM clause to a
relfilenode.

Surely somewhere there we can notice its unlogged before we end up
down in the guts of smgr?

-- 
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services



view thread (23+ messages)  latest in thread

Message-ID: <BANLkTikMKmpSdBCLR2YS0d-rbJEjg1c-pA@mail.gmail.com>
Permalink:  ../BANLkTikMKmpSdBCLR2YS0d-rbJEjg1c-pA@mail.gmail.com/
Also on:    postgresql.org/message-id/BANLkTikMKmpSdBCLR2YS0d-rbJEjg1c-pA@mail.gmail.com

 · 

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 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: simon@2ndQuadrant.com, robertmhaas@gmail.com, tgl@sss.pgh.pa.us, alvherre@commandprompt.com, euler@timbira.com, postgres.arg@gmail.com
  Subject: Re: BUG #6041: Unlogged table was created bad in slave node
  In-Reply-To: <BANLkTikMKmpSdBCLR2YS0d-rbJEjg1c-pA@mail.gmail.com>
  References: <201105261137.p4QBbTlt077425@wwwmaster.postgresql.org> <4DDE7905.6050406@timbira.com> <1306427067-sup-7622@alvh.no-ip.org> <25332.1306427674@sss.pgh.pa.us> <BANLkTim433vF5HWjbJ0FSWm_-xA8DDaGNg@mail.gmail.com> <BANLkTikMKmpSdBCLR2YS0d-rbJEjg1c-pA@mail.gmail.com>

* 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