Re: Phantom segment upon promotion causing troubles.

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-hackers(at)postgresql(dot)org, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, gregburek(at)heroku(dot)com
Subject: Re: Phantom segment upon promotion causing troubles.
Date: 2017-06-19 07:41:23
Message-ID: 20170619074123.wh42uwa7utr5wyya@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2017-06-19 00:30:26 -0700, Andres Freund wrote:
> There seems to be a larger question ehre though: Why does
> XLogFileReadAnyTLI() probe all timelines even if they weren't a parent
> at that period? That seems like a bad idea, especially in more
> complicated scenarios where some precursor timeline might live for
> longer than it was a parent? ISTM XLogFileReadAnyTLI() should check
> which timeline a segment ought to come from, based on the historY?

One thing that I blamed first, before debunking it, is that after
promotion we do:

/*
* Preallocate additional log files, if wanted.
*/
PreallocXlogFiles(EndOfLog);

where EndOfLog points to the last replayed record, rather than last
record(s). I think that's currently harmless, but it's certainly
fragile. Given the uselessness of PreallocXlogFiles() calls, I'm
inclined to just remove it here...

- Andres

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2017-06-19 07:55:07 Re: transition table behavior with inheritance appears broken
Previous Message Andres Freund 2017-06-19 07:30:26 Phantom segment upon promotion causing troubles.