Re: incorrect handling of the timeout in pg_receivexlog

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, 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-06-05 13:39:03
Message-ID: CABUevEyfDg+PXeD=t98X07bQGgF9FT8trtLL9qAQ82Ey3wBGBA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jun 5, 2012 at 3:36 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
> On Tue, Jun 5, 2012 at 5:32 PM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
>> It contains a number of unrelated changes of %m -> %s - what's the
>> motivation for those?
>
> %m in fprintf() is glibc extension according to man page, so it's not portable
> and should not be used, I think.
>
> We discussed this before and reached consensus not to use %m :)
> http://archives.postgresql.org/pgsql-hackers/2011-01/msg01674.php

:-) there goes my memory.

That said, we're using %m in a fairly large number of places already,
but they're mostly in the backend. I guess we're safe there.

Anyway, +1 for making that change then, but I'll make it as a separate patch.

>> You also removed the "safeguard" of always sleeping at least 1 second
>> - should we keep some level of safeguard there, even if it's not in
>> full seconds anymore?
>>
>> Is the -1 sent into localTimestampDifference still relevent at all?
>
> No because that "safeguard" would mess up with a user who sets
> replication_timeout to less than one second. Though I'm not sure
> whether there is really any user who wants such too short timeout....

Right - I meant we might want to adjust the safeguad. Assuming <1 sec
is reasonable, maybe cap it at 100ms or so?

--
 Magnus Hagander
 Me: http://www.hagander.net/
 Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2012-06-05 13:43:57 Backup docs
Previous Message Fujii Masao 2012-06-05 13:36:18 Re: incorrect handling of the timeout in pg_receivexlog