Re: incorrect handling of the timeout in pg_receivexlog

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: incorrect handling of the timeout in pg_receivexlog
Date: 2012-02-28 09:08:25
Message-ID: CAHGQGwHbPfABCPsuYqidw2xBU_MJJLO200EcH33SXiBWbdoyOg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 8, 2012 at 1:33 AM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> On Tue, Feb 7, 2012 at 17:29, Heikki Linnakangas
> <heikki(dot)linnakangas(at)enterprisedb(dot)com> wrote:
>> On 07.02.2012 16:55, Tom Lane wrote:
>>>
>>> (The integer vs float TimestampTz issue is a kind of portability
>>> problem, but we've already bought into the assumption that sender and
>>> receiver must be built with the same choice, no?)
>>
>>
>> Hmm, true. In hindsight, I think that was a bad choice, but it's a bit late
>> to change that. pg_basebackup doesn't otherwise care about the integer/float
>> timestamps, but it does send a timestamp back to the server. You won't be
>> able to actually start up the database if the config options don't match,
>> but I think it would be good if pg_basebackup still worked across platforms
>> and versions. For example, you might have a central backup server that calls
>> pg_basebackup on several database servers, running on different platforms.
>>
>> In 9.0, the only field in the protocol that depends on timestamp format is
>> WalDataMessageHeader->sendTime. That goes from server to client, and
>> pg_basebackup/pg_receivexlog don't care about that. In 9.1 we introduced
>> StandbyReplyMessage->sendTime, which is sent from client to server, but
>> looking at the code it looks like the server doesn't use it for anything. In
>> 9.2, we added WalSndrMessage->sendTime, which is used by a standby server to
>> calculate how far behind the standby is.
>>
>> I'm tempted to just change all of those TimestampTz fields to something
>> that's independent of integer/float timestamp setting, in 9.2. At a quick
>> glance, it seems that it wouldn't break anything.

Agreed. If we'll have not pushed such change into 9.2, we would break
something later.

> In general, I think that would work. Since we can't replicate across
> versions anyway.
>
> Will it break using pg_basebackup 9.2 on a 9.1 server, though? that
> would also be very useful in the scenario of the central server...

No unless I'm missing something. Because pg_basebackup doesn't use
any message which is defined in walprotocol.h if "-x stream" option is
not specified.

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thom Brown 2012-02-28 09:08:46 Re: FDW system columns
Previous Message Shigeru Hanada 2012-02-28 08:38:21 Re: FDW system columns