Re: incorrect handling of the timeout in pg_receivexlog - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: incorrect handling of the timeout in pg_receivexlog
Date
Msg-id CAHGQGwFmWE8qjJ7L_WwdZtxKjXYXyZgGXo6+4ZV6BNb8A6NUrA@mail.gmail.com
Whole thread Raw
In response to incorrect handling of the timeout in pg_receivexlog  (Fujii Masao <masao.fujii@gmail.com>)
Responses Re: incorrect handling of the timeout in pg_receivexlog  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-hackers
On Tue, Feb 7, 2012 at 2:58 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
> Hi,
>
> When I compiled HEAD with --disable-integer-datetimes and tested
> pg_receivexlog, I encountered unexpected replication timeout. As
> far as I read the pg_receivexlog code, the cause of this problem is
> that pg_receivexlog handles the standby message timeout incorrectly
> in --disable-integer-datetimes. The attached patch fixes this problem.
> Comments?

receivelog.c
-------timeout.tv_sec = last_status + standby_message_timeout - now - 1;if (timeout.tv_sec <= 0)
-------

Umm.. the above code also handles the timestamp incorrectly. ISTM that the
root cause of these problems is that receivelog.c uses TimestampTz. What
about changing receivelog.c so that it uses time_t instead of TimestampTz?
Which would make the code simpler, I think.

Regards,

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


pgsql-hackers by date:

Previous
From: Chetan Suttraway
Date:
Subject: Re: patch for implementing SPI_gettypemod()
Next
From: Heikki Linnakangas
Date:
Subject: Re: Group commit, revised