Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-06-10 Thread Magnus Hagander
On Wed, Jun 6, 2012 at 8:10 PM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, Jun 5, 2012 at 11:42 PM, Magnus Hagander mag...@hagander.net wrote: Works for me. We still need a (reworked) patch, though, right? We just move where the move between seconds and milliseconds happens? Attached is

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-06-06 Thread Fujii Masao
On Tue, Jun 5, 2012 at 11:42 PM, Magnus Hagander mag...@hagander.net wrote: Works for me. We still need a (reworked) patch, though, right? We just move where the move between seconds and milliseconds happens? Attached is the updated version of the patch. I definitely don't think we need

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-06-05 Thread Magnus Hagander
On Fri, May 25, 2012 at 7:56 PM, Fujii Masao masao.fu...@gmail.com wrote: On Thu, May 24, 2012 at 4:52 AM, Magnus Hagander mag...@hagander.net wrote: On Wed, May 23, 2012 at 8:11 PM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, May 22, 2012 at 11:04 PM, Robert Haas robertmh...@gmail.com

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-06-05 Thread Fujii Masao
On Tue, Jun 5, 2012 at 5:32 PM, Magnus Hagander mag...@hagander.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

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-06-05 Thread Magnus Hagander
On Tue, Jun 5, 2012 at 3:36 PM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, Jun 5, 2012 at 5:32 PM, Magnus Hagander mag...@hagander.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,

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-06-05 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: On Tue, Jun 5, 2012 at 3:36 PM, Fujii Masao masao.fu...@gmail.com wrote: 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

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-06-05 Thread Fujii Masao
On Tue, Jun 5, 2012 at 10:39 PM, Magnus Hagander mag...@hagander.net wrote: On Tue, Jun 5, 2012 at 3:36 PM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, Jun 5, 2012 at 5:32 PM, Magnus Hagander mag...@hagander.net wrote: You also removed the safeguard of always sleeping at least 1 second -

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-06-05 Thread Magnus Hagander
On Tue, Jun 5, 2012 at 4:28 PM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, Jun 5, 2012 at 10:39 PM, Magnus Hagander mag...@hagander.net wrote: On Tue, Jun 5, 2012 at 3:36 PM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, Jun 5, 2012 at 5:32 PM, Magnus Hagander mag...@hagander.net

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-05-25 Thread Fujii Masao
On Thu, May 24, 2012 at 4:52 AM, Magnus Hagander mag...@hagander.net wrote: On Wed, May 23, 2012 at 8:11 PM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, May 22, 2012 at 11:04 PM, Robert Haas robertmh...@gmail.com wrote: On Mon, May 14, 2012 at 2:24 PM, Fujii Masao masao.fu...@gmail.com

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-05-23 Thread Fujii Masao
On Tue, May 22, 2012 at 11:04 PM, Robert Haas robertmh...@gmail.com wrote: On Mon, May 14, 2012 at 2:24 PM, Fujii Masao masao.fu...@gmail.com wrote: On Fri, May 11, 2012 at 11:43 PM, Magnus Hagander mag...@hagander.net wrote: Should we go down the easy way and just reject connections when the

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-05-23 Thread Magnus Hagander
On Wed, May 23, 2012 at 8:11 PM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, May 22, 2012 at 11:04 PM, Robert Haas robertmh...@gmail.com wrote: On Mon, May 14, 2012 at 2:24 PM, Fujii Masao masao.fu...@gmail.com wrote: On Fri, May 11, 2012 at 11:43 PM, Magnus Hagander mag...@hagander.net

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-05-22 Thread Robert Haas
On Mon, May 14, 2012 at 2:24 PM, Fujii Masao masao.fu...@gmail.com wrote: On Fri, May 11, 2012 at 11:43 PM, Magnus Hagander mag...@hagander.net wrote: Should we go down the easy way and just reject connections when the flag is mismatching between the client and the server (trivial to do - see

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-05-14 Thread Fujii Masao
On Fri, May 11, 2012 at 11:43 PM, Magnus Hagander mag...@hagander.net wrote: Should we go down the easy way and just reject connections when the flag is mismatching between the client and the server (trivial to do - see the attached patch)? + char *tmpparam; You forgot to add

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-05-11 Thread Magnus Hagander
On Thursday, May 10, 2012, Fujii Masao wrote: On Thu, May 10, 2012 at 11:51 PM, Magnus Hagander mag...@hagander.netjavascript:; wrote: And taking this a step further - we *already* send these GUCs. Previous references to us not doing that were incorrect :-) So this should be a much

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-05-11 Thread Tom Lane
Magnus Hagander mag...@hagander.net writes: How common *is* it to have a build that doesn't have integer timestamps these days? Does any of the binary builds do that at all, for example? If it's uncommon enough, I think we should just go with the easy way out... +1 for just rejecting a

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-05-11 Thread Fujii Masao
On Sat, May 12, 2012 at 12:44 AM, Tom Lane t...@sss.pgh.pa.us wrote: Magnus Hagander mag...@hagander.net writes: How common *is* it to have a build that doesn't have integer timestamps these days? Does any of the binary builds do that at all, for example? If it's uncommon enough, I think we

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-05-10 Thread Magnus Hagander
Argh. This thread appears to have been forgotten - sorry about that. Given that we're taling about a potential protocol change, we really should resolve this before we wrap beta, no? On Thu, Mar 29, 2012 at 6:43 AM, Fujii Masao masao.fu...@gmail.com wrote: On Tue, Feb 28, 2012 at 6:08 PM,

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-05-10 Thread Magnus Hagander
On Thu, May 10, 2012 at 3:04 PM, Magnus Hagander mag...@hagander.net wrote: Argh. This thread appears to have been forgotten - sorry about that. Given that we're taling about a potential protocol change, we really should resolve this before we wrap beta, no? Had a chat with Heikki about this,

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-05-10 Thread Magnus Hagander
On Thu, May 10, 2012 at 4:43 PM, Magnus Hagander mag...@hagander.net wrote: On Thu, May 10, 2012 at 3:04 PM, Magnus Hagander mag...@hagander.net wrote: Argh. This thread appears to have been forgotten - sorry about that. Given that we're taling about a potential protocol change, we really

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-05-10 Thread Fujii Masao
On Thu, May 10, 2012 at 11:51 PM, Magnus Hagander mag...@hagander.net wrote: And taking this a step further - we *already* send these GUCs. Previous references to us not doing that were incorrect :-) So this should be a much easier fix than we thought. And can be done entirely in

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-03-28 Thread Fujii Masao
On Tue, Feb 28, 2012 at 6:08 PM, Fujii Masao masao.fu...@gmail.com wrote: On Wed, Feb 8, 2012 at 1:33 AM, Magnus Hagander mag...@hagander.net wrote: 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

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-02-28 Thread Fujii Masao
On Wed, Feb 8, 2012 at 1:33 AM, Magnus Hagander mag...@hagander.net wrote: On Tue, Feb 7, 2012 at 17:29, Heikki Linnakangas heikki.linnakan...@enterprisedb.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

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-02-07 Thread Heikki Linnakangas
On 07.02.2012 09:03, Fujii Masao wrote: On Tue, Feb 7, 2012 at 2:58 PM, Fujii Masaomasao.fu...@gmail.com wrote: 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

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-02-07 Thread Magnus Hagander
On Tue, Feb 7, 2012 at 10:31, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: On 07.02.2012 09:03, Fujii Masao wrote: On Tue, Feb 7, 2012 at 2:58 PM, Fujii Masaomasao.fu...@gmail.com  wrote: When I compiled HEAD with --disable-integer-datetimes and tested pg_receivexlog, I

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-02-07 Thread Heikki Linnakangas
On 07.02.2012 11:35, Magnus Hagander wrote: On Tue, Feb 7, 2012 at 10:31, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: So, --statusint needs to be in milliseconds. And while we're at it, how difficult would be to ask the server for the current value of replication_timeout, and

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-02-07 Thread Magnus Hagander
On Tue, Feb 7, 2012 at 10:55, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: On 07.02.2012 11:35, Magnus Hagander wrote: On Tue, Feb 7, 2012 at 10:31, Heikki Linnakangas heikki.linnakan...@enterprisedb.com  wrote: So, --statusint needs to be in milliseconds. And while we're at

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-02-07 Thread Fujii Masao
On Tue, Feb 7, 2012 at 7:06 PM, Magnus Hagander mag...@hagander.net wrote: On Tue, Feb 7, 2012 at 10:55, Heikki Linnakangas heikki.linnakan...@enterprisedb.com wrote: On 07.02.2012 11:35, Magnus Hagander wrote: On Tue, Feb 7, 2012 at 10:31, Heikki Linnakangas

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-02-07 Thread Tom Lane
Heikki Linnakangas heikki.linnakan...@enterprisedb.com writes: On 07.02.2012 09:03, Fujii Masao wrote: What about changing receivelog.c so that it uses time_t instead of TimestampTz? Which would make the code simpler, I think. Hmm, that would reduce granularity to seconds. It also creates

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-02-07 Thread Heikki Linnakangas
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

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-02-07 Thread Magnus Hagander
On Tue, Feb 7, 2012 at 17:29, Heikki Linnakangas heikki.linnakan...@enterprisedb.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

[HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-02-06 Thread Fujii Masao
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

Re: [HACKERS] incorrect handling of the timeout in pg_receivexlog

2012-02-06 Thread Fujii Masao
On Tue, Feb 7, 2012 at 2:58 PM, Fujii Masao masao.fu...@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