pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Andres Freund <andres@2ndquadrant.com>
Cc: PostgreSQL-development <pgsql-hackers@postgreSQL.org>
Subject: Re: [COMMITTERS] pgsql: Change how first WAL segment on new timeline after promotion is
Date: Wed, 7 Jan 2015 16:24:02 +0200
Message-ID: <54AD4182.7040601@vmware.com> (raw)
In-Reply-To: <20150106132257.GE15316@alap3.anarazel.de>
References: <E1Y1flH-000118-KB@gemulon.postgresql.org>
	<20150103185957.GB15316@alap3.anarazel.de>
	<54AABFA2.3050409@vmware.com>
	<20150106132257.GE15316@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 01/06/2015 03:22 PM, Andres Freund wrote:
> On 2015-01-05 18:45:22 +0200, Heikki Linnakangas wrote:
>> On 01/03/2015 08:59 PM, Andres Freund wrote:
>>> Did you perhaps intend to use XLogFileInit(use_existing = true)
>>> instead of XLogFileOpen()? That works for me.
>>
>> Hmm, that doesn't sound right either. XLogFileInit is used when you switch
>> to a new segment, not to open an old segment for writing. It happens to
>> work, because with use_existing = true it will in fact always open the old
>> segment, instead of creating a new one, but I don't think that's in the
>> spirit of how that function's intended to be used.
>
> Well, its docs say "Create a new XLOG file segment, or open a
> pre-existing one.", so it's not that mismatched. We really don't know
> whether the EndOfLog's segment already exist in this scenario.  Also,
> doesn't XLogWrite() essentially use it in the same way?

XLogWrite() is smarter. It uses XLogFileInit() when switching to a new 
segment, and XLogFileOpen when writing to the middle of a segment.

Committed the fix to not open the segment at all.

- Heikki



-- 
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 (7+ messages)

Message-ID: <54AD4182.7040601@vmware.com>
Permalink:  ../54AD4182.7040601@vmware.com/
Also on:    postgresql.org/message-id/54AD4182.7040601@vmware.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-committers@postgresql.org
  Cc: hlinnakangas@vmware.com, andres@2ndquadrant.com, pgsql-hackers@postgreSQL.org
  Subject: Re: [COMMITTERS] pgsql: Change how first WAL segment on new timeline after promotion is
  In-Reply-To: <54AD4182.7040601@vmware.com>
  References: <E1Y1flH-000118-KB@gemulon.postgresql.org> <20150103185957.GB15316@alap3.anarazel.de> <54AABFA2.3050409@vmware.com> <20150106132257.GE15316@alap3.anarazel.de> <54AD4182.7040601@vmware.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