pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedReview of "pg_basebackup and pg_receivexlog to use non-blocking socket communication", was: Re: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
11+ messages / 6 participants
[nested] [flat]
* Review of "pg_basebackup and pg_receivexlog to use non-blocking socket communication", was: Re: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
@ 2013-01-01 16:48 Boszormenyi Zoltan <zb@cybertec.at>
0 siblings, 4 replies; 11+ messages in thread
From: Boszormenyi Zoltan @ 2013-01-01 16:48 UTC (permalink / raw)
To: Amit kapila <amit.kapila@huawei.com>; +Cc: Fujii Masao <masao.fujii@gmail.com>; Heikki Linnakangas <hlinnakangas@vmware.com>; pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Hi,
2012-11-15 14:59 keltezéssel, Amit kapila írta:
> On Monday, November 12, 2012 8:23 PM Fujii Masao wrote:
> On Fri, Nov 9, 2012 at 3:03 PM, Amit Kapila <amit.kapila@huawei.com> wrote:
>> On Thursday, November 08, 2012 10:42 PM Fujii Masao wrote:
>>> On Thu, Nov 8, 2012 at 5:53 PM, Amit Kapila <amit.kapila@huawei.com>
>>> wrote:
>>>> On Thursday, November 08, 2012 2:04 PM Heikki Linnakangas wrote:
>>>>> On 19.10.2012 14:42, Amit kapila wrote:
>>>>>> On Thursday, October 18, 2012 8:49 PM Fujii Masao wrote:
>>>> Are you planning to introduce the timeout mechanism in pg_basebackup
>>>> main process? Or background process? It's useful to implement both.
>>> By background process, you mean ReceiveXlogStream?
>>> For both.
>>> I think for background process, it can be done in a way similar to what we
>>> have done for walreceiver.
>> Yes.
>>> But I have some doubts for how to do for main process:
>>> Logic similar to walreceiver can not be used incase network goes down during
>>> getting other database file from server.
>>> The reason for the same is to receive the data files PQgetCopyData() is
>>> called in synchronous mode, so it keeps waiting for infinite time till it
>>> gets some data.
>>> In order to solve this issue, I can think of following options:
>>> 1. Making this call also asynchronous (but now sure about impact of this).
>> +1
>> Walreceiver already calls PQgetCopyData() asynchronously. ISTM you can
>> solve the issue in the similar way to walreceiver's.
>>> 2. In function pqWait, instead of passing hard-code value -1 (i.e. infinite
>>> wait), we can send some finite time. This time can be received as command
>>> line argument
>>> from respective utility and set the same in PGconn structure.
>> Yes, I think that we should add something like --conninfo option to
>> pg_basebackup
>> and pg_receivexlog. We can easily set not only connect_timeout but also sslmode,
>> application_name, ... by using such option accepting conninfo string.
> I have prepared an attached patch to make pg_basebackup and pg_receivexlog as non-blocking.
> To do so I have to add new command line parameters in pg_basebackup and pg_receivexlog
> for now added two more command line arguments
> a. "-r" for pg_basebackup and pg_receivexlog to take receive time-out value. Default value for this parameter is 60 sec.
> b. "-t" for pg_basebackup and pg_receivexlog to take initial connection timeout value. Default value is infinite wait.
> We can change to accept --conninfo as well.
>
> I feel apart from above, remaining problem is for function call PQgetResult()
> 1. Wherever query is getting sent from BaseBackup, it calls the function PQgetResult to receive the result of query.
> As PQgetResult() is blocking function (it calls pqWait which can hang), so if network is down before sending the query itself,
> then there will not be any result, so it will keep hanging in PQgetResult .
> IMO, it can be solved in below ways:
> a. Create one corresponding non-blocking function. But this function is being called from inside some of the
> other libpq function (PQexec->PQexecFinish->PQgetResult). So it can be little tricky to solve this way.
> b. Add the receive_timeout variable in PGconn structure and use it in pqWait for timeout whenever it is set.
> c. any other better way?
>
>
>>> BTW, IIRC the walsender has no timeout mechanism during sending
>>> backup data to pg_basebackup. So it's also useful to implement the
>>> timeout mechanism for the walsender during backup.
>> What about using pq_putmessage_noblock()?
> I think may be some more functions also needs to be made as noblock. I am still evaluating.
>
> I will upload the attached patch in commitfest if you don't have any objections?
>
> More Suggestions/Comments?
>
> With Regards,
> Amit Kapila.
I am reviewing your patch.
* Is the patch in context diff format <http://en.wikipedia.org/wiki/Diff#Context_format;?
Yes.
* Does it apply cleanly to the current git master?
Not quite cleanly but it doesn't produce rejects or fuzz, only offset warnings:
[zozo@localhost postgresql]$ cat ../noblock_basebackup_and_receivexlog.patch | patch -p1
patching file src/bin/pg_basebackup/pg_basebackup.c
Hunk #1 succeeded at 41 (offset -6 lines).
Hunk #2 succeeded at 123 (offset -6 lines).
Hunk #3 succeeded at 239 (offset -6 lines).
Hunk #4 succeeded at 292 (offset -6 lines).
Hunk #5 succeeded at 470 (offset -6 lines).
Hunk #6 succeeded at 588 (offset -6 lines).
Hunk #7 succeeded at 601 (offset -6 lines).
Hunk #8 succeeded at 727 (offset -6 lines).
Hunk #9 succeeded at 779 (offset -6 lines).
Hunk #10 succeeded at 797 (offset -6 lines).
Hunk #11 succeeded at 811 (offset -6 lines).
Hunk #12 succeeded at 879 (offset -6 lines).
Hunk #13 succeeded at 1080 (offset -6 lines).
Hunk #14 succeeded at 1381 (offset -6 lines).
Hunk #15 succeeded at 1409 (offset -6 lines).
Hunk #16 succeeded at 1521 (offset -6 lines).
patching file src/bin/pg_basebackup/pg_receivexlog.c
Hunk #1 succeeded at 35 (offset -6 lines).
Hunk #2 succeeded at 65 (offset -6 lines).
Hunk #3 succeeded at 224 (offset -6 lines).
Hunk #4 succeeded at 281 (offset -6 lines).
Hunk #5 succeeded at 314 (offset -6 lines).
Hunk #6 succeeded at 341 (offset -5 lines).
Hunk #7 succeeded at 379 (offset -5 lines).
patching file src/bin/pg_basebackup/receivelog.c
Hunk #1 succeeded at 181 (offset -9 lines).
Hunk #2 succeeded at 201 (offset -9 lines).
Hunk #3 succeeded at 223 (offset -9 lines).
Hunk #4 succeeded at 333 (offset -9 lines).
Hunk #5 succeeded at 342 (offset -9 lines).
Hunk #6 succeeded at 397 (offset -9 lines).
Hunk #7 succeeded at 484 (offset -9 lines).
Hunk #8 succeeded at 533 (offset -9 lines).
Hunk #9 succeeded at 550 (offset -9 lines).
patching file src/bin/pg_basebackup/receivelog.h
patching file src/bin/pg_basebackup/streamutil.c
Hunk #1 succeeded at 66 (offset -6 lines).
Hunk #2 succeeded at 87 (offset -6 lines).
Hunk #3 succeeded at 118 (offset -6 lines).
patching file src/bin/pg_basebackup/streamutil.h
* Does it include reasonable tests, necessary doc patches, etc?
The test cases are not applicable. There is no test framework for
testing network outage in "make check".
There are no documentation patches for the new --recvtimeout=INTERVAL
and --conntimeout=INTERVAL options for either pg_basebackup or
pg_receivexlog.
* Does the patch actually implement that?
It seems so, the patch adds the connect_timeout parameter to
the connection options and uses PQgetCopyData(..., 1) to get
the data asynchronously and uses select(2) to watch for incoming
data.
* Do we want that?
It can speed up detecting network breakdown so yes.
* Do we already have it?
No.
* Does it follow SQL spec, or the community-agreed behavior?
There's no such SQL spec. The behaviour is desired.
* Does it include pg_dump support (if applicable)?
Not applicable.
* Are there dangers?
The patch author researched more functions that need
to be extended in a nonblocking way.
http://archives.postgresql.org/pgsql-hackers/2012-11/msg00863.php
* Have all the bases been covered?
For pg_basebackup/pg_receivexlog (for PQgetCopyData and
PQconnect), yes.
Per the previous comment, no. But those are for the backend
to notice network breakdowns and as such, they need a
separate patch.
* Does the feature work as advertised?
Yes.
I tested it between two machines and pulled the ethernet
plug while pg_basebackup was running. With "-r 2", pg_basebackup
detected the timeout after 2 seconds. Without the patch, I lost
patience after two minutes and pressed Ctrl-C in pg_basebackup.
I also tested pg_receivexlog and it also noticed the network error
in the specified timeout.
* Are there corner cases the author has failed to consider?
As far as I can see in the client-side libpq code flow, no.
* Are there any assertion failures or crashes?
Not applicable, the patch is for client applicatiions.
* Does the patch slow down simple tests?
No.
* If it claims to improve performance, does it?
Not applicable, not a performance patch. But it really
improves detecting network breakdown.
* Does it slow down other things?
No.
* Does it follow the project coding guidelines
<http://developer.postgresql.org/pgdocs/postgres/source.html;?
Yes.
* Are there portability issues?
No. It introduces atoi() and select() as new calls, these are portable.
* Will it work on Windows/BSD etc?
It should.
* Are the comments sufficient and accurate?
This chunk below removes a comment which seems obvious enough
so it's not needed:
***************
*** 518,524 **** ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
goto error;
}
! /* Check the message type. */
if (copybuf[0] == 'k')
{
int pos;
--- 559,568 ----
goto error;
}
! /* Set the last reply timestamp */
! last_recv_timestamp = localGetCurrentTimestamp();
! ping_sent = false;
!
if (copybuf[0] == 'k')
{
int pos;
***************
Other comments are sufficient and accurate.
* Does it do what it says, correctly?
This question is redundant with the above "Does the feature work as advertised?"
So yes.
* Does it produce compiler warnings?
No.
* Can you make it crash?
No.
* Is everything done in a way that fits together coherently with other features/modules?
Yes.
* Are there interdependencies that can cause problems?
No.
Best regards,
Zoltán Böszörményi
--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
http://www.postgresql.at/
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Review of "pg_basebackup and pg_receivexlog to use non-blocking socket communication", was: Re: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
@ 2013-01-02 07:11 Hari Babu <haribabu.kommi@huawei.com>
parent: Boszormenyi Zoltan <zb@cybertec.at>
3 siblings, 0 replies; 11+ messages in thread
From: Hari Babu @ 2013-01-02 07:11 UTC (permalink / raw)
To: 'Boszormenyi Zoltan' <zb@cybertec.at>; +Cc: 'Fujii Masao' <masao.fujii@gmail.com>; 'Heikki Linnakangas' <hlinnakangas@vmware.com>; pgsql-hackers@postgresql.org; 'Amit kapila' <amit.kapila@huawei.com>
On January 01, 2013 10:19 PM Boszormenyi Zoltan wrote:
>I am reviewing your patch.
>• Is the patch in context diff format?
>Yes.
Thanks for reviewing the patch.
>• Does it apply cleanly to the current git master?
>Not quite cleanly but it doesn't produce rejects or fuzz, only offset
warnings:
Will rebase the patch to head.
>• Does it include reasonable tests, necessary doc patches, etc?
>The test cases are not applicable. There is no test framework for
>testing network outage in "make check".
>
>There are no documentation patches for the new --recvtimeout=INTERVAL
>and --conntimeout=INTERVAL options for either pg_basebackup or
>pg_receivexlog.
I will add the documentation for the same.
>Per the previous comment, no. But those are for the backend
>to notice network breakdowns and as such, they need a
>separate patch.
I also think it is better to handle it as a separate patch for walsender.
>• Are the comments sufficient and accurate?
>This chunk below removes a comment which seems obvious enough
>so it's not needed:
>***************
>*** 518,524 **** ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos,
uint32 timeline,
> goto error;
> }
>
>! /* Check the message type. */
> if (copybuf[0] == 'k')
> {
> int pos;
>--- 559,568 ----
> goto error;
> }
>
>! /* Set the last reply timestamp */
>! last_recv_timestamp = localGetCurrentTimestamp();
>! ping_sent = false;
>!
> if (copybuf[0] == 'k')
> {
> int pos;
>***************
>
>Other comments are sufficient and accurate.
I will fix and update the patch.
Please let me know if anything apart from above needs to be taken care.
Regards,
Hari babu.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Review of "pg_basebackup and pg_receivexlog to use non-blocking socket communication", was: Re: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
@ 2013-01-04 12:43 Hari Babu <haribabu.kommi@huawei.com>
parent: Boszormenyi Zoltan <zb@cybertec.at>
3 siblings, 0 replies; 11+ messages in thread
From: Hari Babu @ 2013-01-04 12:43 UTC (permalink / raw)
To: 'Boszormenyi Zoltan' <zb@cybertec.at>; +Cc: 'Fujii Masao' <masao.fujii@gmail.com>; 'Heikki Linnakangas' <hlinnakangas@vmware.com>; pgsql-hackers@postgresql.org; 'Amit kapila' <amit.kapila@huawei.com>
On January 02, 2013 12:41 PM Hari Babu wrote:
>On January 01, 2013 10:19 PM Boszormenyi Zoltan wrote:
>>I am reviewing your patch.
>>• Is the patch in context diff format?
>>Yes.
>
>Thanks for reviewing the patch.
>
>>• Does it apply cleanly to the current git master?
>>Not quite cleanly but it doesn't produce rejects or fuzz, only offset
warnings:
>
>Will rebase the patch to head.
>
>>• Does it include reasonable tests, necessary doc patches, etc?
>>The test cases are not applicable. There is no test framework for
>>testing network outage in "make check".
>>
>>There are no documentation patches for the new --recvtimeout=INTERVAL
>>and --conntimeout=INTERVAL options for either pg_basebackup or
>>pg_receivexlog.
>
>I will add the documentation for the same.
>
>>Per the previous comment, no. But those are for the backend
>>to notice network breakdowns and as such, they need a
>>separate patch.
>
>I also think it is better to handle it as a separate patch for walsender.
>
>>• Are the comments sufficient and accurate?
>>This chunk below removes a comment which seems obvious enough
>>so it's not needed:
>>***************
>>*** 518,524 **** ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos,
uint32 timeline,
>> goto error;
>> }
>>
>>! /* Check the message type. */
>> if (copybuf[0] == 'k')
>> {
>> int pos;
>>--- 559,568 ----
>> goto error;
>> }
>>
>>! /* Set the last reply timestamp */
>>! last_recv_timestamp = localGetCurrentTimestamp();
>>! ping_sent = false;
>>!
>> if (copybuf[0] == 'k')
>> {
>> int pos;
>>***************
>>
>>Other comments are sufficient and accurate.
>
>I will fix and update the patch.
The attached V2 patch in the mail handles all the review comments identified
above.
Regards,
Hari babu.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
pg_basebkup_recvxlog_noblock_comm_v2.patch (application/octet-stream, 24.3K) download
*** a/doc/src/sgml/ref/pg_basebackup.sgml
--- b/doc/src/sgml/ref/pg_basebackup.sgml
***************
*** 386,391 **** PostgreSQL documentation
--- 386,411 ----
</varlistentry>
<varlistentry>
+ <term><option>-r <replaceable class="parameter">interval</replaceable></option></term>
+ <term><option>--recvtimeout=<replaceable class="parameter">interval</replaceable></option></term>
+ <listitem>
+ <para>
+ time that receiver waits for communication from server (in seconds).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-t <replaceable class="parameter">interval</replaceable></option></term>
+ <term><option>--conntimeout=<replaceable class="parameter">interval</replaceable></option></term>
+ <listitem>
+ <para>
+ time that client wait for connection to establish with server (in seconds).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-U <replaceable>username</replaceable></option></term>
<term><option>--username=<replaceable class="parameter">username</replaceable></option></term>
<listitem>
*** a/doc/src/sgml/ref/pg_receivexlog.sgml
--- b/doc/src/sgml/ref/pg_receivexlog.sgml
***************
*** 164,169 **** PostgreSQL documentation
--- 164,189 ----
</varlistentry>
<varlistentry>
+ <term><option>-r <replaceable class="parameter">interval</replaceable></option></term>
+ <term><option>--recvtimeout=<replaceable class="parameter">interval</replaceable></option></term>
+ <listitem>
+ <para>
+ time that receiver waits for communication from server (in seconds).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-t <replaceable class="parameter">interval</replaceable></option></term>
+ <term><option>--conntimeout=<replaceable class="parameter">interval</replaceable></option></term>
+ <listitem>
+ <para>
+ time that client wait for connection to establish with server (in seconds).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-U <replaceable>username</replaceable></option></term>
<term><option>--username=<replaceable class="parameter">username</replaceable></option></term>
<listitem>
*** a/src/bin/pg_basebackup/pg_basebackup.c
--- b/src/bin/pg_basebackup/pg_basebackup.c
***************
*** 41,46 **** bool includewal = false;
--- 41,50 ----
bool streamwal = false;
bool fastcheckpoint = false;
int standby_message_timeout = 10 * 1000; /* 10 sec = default */
+ int standby_recv_timeout = 60*1000; /* 60 sec = default */
+ char *standby_connect_timeout = NULL;
+
+ #define NAPTIME_PER_CYCLE 100 /* max sleep time between cycles (100ms) */
/* Progress counters */
static uint64 totalsize;
***************
*** 119,124 **** usage(void)
--- 123,132 ----
printf(_(" -p, --port=PORT database server port number\n"));
printf(_(" -s, --status-interval=INTERVAL\n"
" time between status packets sent to server (in seconds)\n"));
+ printf(_(" -r, --recvtimeout=INTERVAL time that receiver waits for communication from\n"
+ " server (in seconds)\n"));
+ printf(_(" -t, --conntimeout=INTERVAL time that client wait for connection to establish\n"
+ " with server (in seconds)\n"));
printf(_(" -U, --username=NAME connect as specified database user\n"));
printf(_(" -w, --no-password never prompt for password\n"));
printf(_(" -W, --password force password prompt (should happen automatically)\n"));
***************
*** 231,238 **** LogStreamerMain(logstreamer_param *param)
{
if (!ReceiveXlogStream(param->bgconn, param->startptr, param->timeline,
param->sysidentifier, param->xlogdir,
! reached_end_position, standby_message_timeout,
! true))
/*
* Any errors will already have been reported in the function process,
--- 239,246 ----
{
if (!ReceiveXlogStream(param->bgconn, param->startptr, param->timeline,
param->sysidentifier, param->xlogdir,
! reached_end_position, standby_message_timeout,
! standby_recv_timeout, true))
/*
* Any errors will already have been reported in the function process,
***************
*** 284,291 **** StartLogStreamer(char *startpos, uint32 timeline, char *sysidentifier)
}
#endif
! /* Get a second connection */
! param->bgconn = GetConnection();
if (!param->bgconn)
/* Error message already written in GetConnection() */
exit(1);
--- 292,300 ----
}
#endif
! /* Get a second connection. Sending connect_timeout
! * as configured, there is no need for rw_timeout.*/
! param->bgconn = GetConnection(standby_connect_timeout);
if (!param->bgconn)
/* Error message already written in GetConnection() */
exit(1);
***************
*** 461,466 **** ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
--- 470,476 ----
char filename[MAXPGPATH];
char *copybuf = NULL;
FILE *tarfile = NULL;
+ int64 last_recv_timestamp;
#ifdef HAVE_LIBZ
gzFile ztarfile = NULL;
***************
*** 578,586 **** ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
--- 588,599 ----
disconnect_and_exit(1);
}
+ /* Set the last reply timestamp */
+ last_recv_timestamp = localGetCurrentTimestamp();
while (1)
{
int r;
+ int64 now;
if (copybuf != NULL)
{
***************
*** 588,594 **** ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
copybuf = NULL;
}
! r = PQgetCopyData(conn, ©buf, 0);
if (r == -1)
{
/*
--- 601,662 ----
copybuf = NULL;
}
! r = PQgetCopyData(conn, ©buf, 1);
! if (r == 0)
! {
! /*
! * In async mode, and no data available. We block on reading but
! * not more than the specified timeout, so that we can send a
! * response back to the client.
! */
! fd_set input_mask;
! struct timeval timeout;
!
! FD_ZERO(&input_mask);
! FD_SET(PQsocket(conn), &input_mask);
! timeout.tv_sec = 0;
! timeout.tv_usec = NAPTIME_PER_CYCLE*1000;
!
! r = select(PQsocket(conn) + 1, &input_mask, NULL, NULL, &timeout);
! if (r == 0 || (r < 0 && errno == EINTR))
! {
! /*
! * Got a timeout or signal. Before Continuing the loop, check for timeout.
! */
! if (standby_recv_timeout > 0)
! {
! now = localGetCurrentTimestamp();
! if (localTimestampDifferenceExceeds(last_recv_timestamp, now, standby_recv_timeout))
! {
! fprintf(stderr, _("%s: terminating DB File receive due to timeout\n"),
! progname);
! disconnect_and_exit(1);
! }
! }
!
! continue;
! }
! else if (r < 0)
! {
! fprintf(stderr, _("%s: select() failed: %s\n"),
! progname, strerror(errno));
! disconnect_and_exit(1);
! }
! /* Else there is actually data on the socket */
! if (PQconsumeInput(conn) == 0)
! {
! fprintf(stderr,
! _("%s: could not receive data from WAL Sender: %s"),
! progname, PQerrorMessage(conn));
! disconnect_and_exit(1);
! }
!
! /* Set the last reply timestamp */
! last_recv_timestamp = localGetCurrentTimestamp();
!
! /* Some data is received, so go back read them in buffer*/
! continue;
! }
if (r == -1)
{
/*
***************
*** 659,664 **** ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
--- 727,735 ----
disconnect_and_exit(1);
}
+ /* Set the last reply timestamp */
+ last_recv_timestamp = localGetCurrentTimestamp();
+
#ifdef HAVE_LIBZ
if (ztarfile != NULL)
{
***************
*** 708,713 **** ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
--- 779,785 ----
int current_padding = 0;
char *copybuf = NULL;
FILE *file = NULL;
+ int64 last_recv_timestamp;
if (PQgetisnull(res, rownum, 0))
strcpy(current_path, basedir);
***************
*** 725,733 **** ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
--- 797,809 ----
disconnect_and_exit(1);
}
+ /* Set the last reply timestamp */
+ last_recv_timestamp = localGetCurrentTimestamp();
while (1)
{
int r;
+ int64 now;
+
if (copybuf != NULL)
{
***************
*** 735,742 **** ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
copybuf = NULL;
}
! r = PQgetCopyData(conn, ©buf, 0);
if (r == -1)
{
/*
--- 811,872 ----
copybuf = NULL;
}
! r = PQgetCopyData(conn, ©buf, 1);
! if (r == 0)
! {
! /*
! * In async mode, and no data available. We block on reading but
! * not more than the specified timeout, so that we can send a
! * response back to the client.
! */
! fd_set input_mask;
! struct timeval timeout;
!
! FD_ZERO(&input_mask);
! FD_SET(PQsocket(conn), &input_mask);
! timeout.tv_sec = 0;
! timeout.tv_usec = NAPTIME_PER_CYCLE*1000;
+ r = select(PQsocket(conn) + 1, &input_mask, NULL, NULL, &timeout);
+ if (r == 0 || (r < 0 && errno == EINTR))
+ {
+ /*
+ * Got a timeout or signal. Before Continuing the loop, check for timeout.
+ */
+ if (standby_recv_timeout > 0)
+ {
+ now = localGetCurrentTimestamp();
+ if (localTimestampDifferenceExceeds(last_recv_timestamp, now, standby_recv_timeout))
+ {
+ fprintf(stderr, _("%s: terminating DB File receive due to timeout\n"),
+ progname);
+ disconnect_and_exit(1);
+ }
+ }
+
+ continue;
+ }
+ else if (r < 0)
+ {
+ fprintf(stderr, _("%s: select() failed: %s\n"),
+ progname, strerror(errno));
+ disconnect_and_exit(1);
+ }
+ /* Else there is actually data on the socket */
+ if (PQconsumeInput(conn) == 0)
+ {
+ fprintf(stderr,
+ _("%s: could not receive data from WAL Sender: %s"),
+ progname, PQerrorMessage(conn));
+ disconnect_and_exit(1);
+ }
+
+ /* Set the last reply timestamp */
+ last_recv_timestamp = localGetCurrentTimestamp();
+
+ /* Some data is received, so go back read them in buffer*/
+ continue;
+ }
if (r == -1)
{
/*
***************
*** 749,759 **** ReceiveAndUnpackTarFile(PGconn *conn, PGresult *res, int rownum)
}
else if (r == -2)
{
fprintf(stderr, _("%s: could not read COPY data: %s"),
progname, PQerrorMessage(conn));
disconnect_and_exit(1);
}
!
if (file == NULL)
{
int filemode;
--- 879,892 ----
}
else if (r == -2)
{
+ fprintf(stderr, "\n");
fprintf(stderr, _("%s: could not read COPY data: %s"),
progname, PQerrorMessage(conn));
disconnect_and_exit(1);
}
!
! /* Set the last reply timestamp */
! last_recv_timestamp = localGetCurrentTimestamp();
if (file == NULL)
{
int filemode;
***************
*** 947,955 **** BaseBackup(void)
char xlogend[64];
/*
! * Connect in replication mode to the server
*/
! conn = GetConnection();
if (!conn)
/* Error message already written in GetConnection() */
exit(1);
--- 1080,1088 ----
char xlogend[64];
/*
! * Connect in replication mode to the server. Sending connect_timeout.
*/
! conn = GetConnection(standby_connect_timeout);
if (!conn)
/* Error message already written in GetConnection() */
exit(1);
***************
*** 1248,1253 **** main(int argc, char **argv)
--- 1381,1388 ----
{"no-password", no_argument, NULL, 'w'},
{"password", no_argument, NULL, 'W'},
{"status-interval", required_argument, NULL, 's'},
+ {"recvtimeout", required_argument, NULL, 'r'},
+ {"conntimeout", required_argument, NULL, 't'},
{"verbose", no_argument, NULL, 'v'},
{"progress", no_argument, NULL, 'P'},
{NULL, 0, NULL, 0}
***************
*** 1274,1280 **** main(int argc, char **argv)
}
}
! while ((c = getopt_long(argc, argv, "D:F:xX:l:zZ:c:h:p:U:s:wWvP",
long_options, &option_index)) != -1)
{
switch (c)
--- 1409,1415 ----
}
}
! while ((c = getopt_long(argc, argv, "D:F:xX:l:zZ:c:h:p:U:s:r:t:wWvP",
long_options, &option_index)) != -1)
{
switch (c)
***************
*** 1386,1391 **** main(int argc, char **argv)
--- 1521,1546 ----
exit(1);
}
break;
+ case 'r':
+ standby_recv_timeout = atoi(optarg)*1000;
+ if (standby_recv_timeout < 0)
+ {
+ fprintf(stderr, _("%s: invalid recv timeout \"%s\"\n"),
+ progname, optarg);
+ exit(1);
+ }
+
+ break;
+ case 't':
+ if (atoi(optarg) < 0)
+ {
+ fprintf(stderr, _("%s: invalid connect timeout \"%s\"\n"),
+ progname, optarg);
+ exit(1);
+ }
+
+ standby_connect_timeout = pg_strdup(optarg);
+ break;
case 'v':
verbose++;
break;
*** a/src/bin/pg_basebackup/pg_receivexlog.c
--- b/src/bin/pg_basebackup/pg_receivexlog.c
***************
*** 35,40 **** char *basedir = NULL;
--- 35,42 ----
int verbose = 0;
int noloop = 0;
int standby_message_timeout = 10 * 1000; /* 10 sec = default */
+ int standby_recv_timeout = 60*1000; /* 60 sec = default */
+ char *standby_connect_timeout = NULL;
volatile bool time_to_abort = false;
***************
*** 63,68 **** usage(void)
--- 65,74 ----
printf(_(" -p, --port=PORT database server port number\n"));
printf(_(" -s, --status-interval=INTERVAL\n"
" time between status packets sent to server (in seconds)\n"));
+ printf(_(" -r, --recvtimeout=INTERVAL time that receiver waits for communication from\n"
+ " server (in seconds)\n"));
+ printf(_(" -t, --conntimeout=INTERVAL time that client wait for connection to establish\n"
+ " with server (in seconds)\n"));
printf(_(" -U, --username=NAME connect as specified database user\n"));
printf(_(" -w, --no-password never prompt for password\n"));
printf(_(" -W, --password force password prompt (should happen automatically)\n"));
***************
*** 218,226 **** StreamLog(void)
lo;
/*
! * Connect in replication mode to the server
*/
! conn = GetConnection();
if (!conn)
/* Error message already written in GetConnection() */
return;
--- 224,233 ----
lo;
/*
! * Connect in replication mode to the server, Sending connect_timeout
! * as configured, there is no need for rw_timeout.
*/
! conn = GetConnection(standby_connect_timeout);
if (!conn)
/* Error message already written in GetConnection() */
return;
***************
*** 274,280 **** StreamLog(void)
timeline);
ReceiveXlogStream(conn, startpos, timeline, NULL, basedir,
! stop_streaming, standby_message_timeout, false);
PQfinish(conn);
}
--- 281,288 ----
timeline);
ReceiveXlogStream(conn, startpos, timeline, NULL, basedir,
! stop_streaming, standby_message_timeout,
! standby_recv_timeout, false);
PQfinish(conn);
}
***************
*** 306,311 **** main(int argc, char **argv)
--- 314,321 ----
{"no-password", no_argument, NULL, 'w'},
{"password", no_argument, NULL, 'W'},
{"status-interval", required_argument, NULL, 's'},
+ {"recvtimeout", required_argument, NULL, 'r'},
+ {"conntimeout", required_argument, NULL, 't'},
{"verbose", no_argument, NULL, 'v'},
{NULL, 0, NULL, 0}
};
***************
*** 331,337 **** main(int argc, char **argv)
}
}
! while ((c = getopt_long(argc, argv, "D:h:p:U:s:nwWv",
long_options, &option_index)) != -1)
{
switch (c)
--- 341,347 ----
}
}
! while ((c = getopt_long(argc, argv, "D:h:p:U:s:r:t:nwWv",
long_options, &option_index)) != -1)
{
switch (c)
***************
*** 369,374 **** main(int argc, char **argv)
--- 379,404 ----
exit(1);
}
break;
+ case 'r':
+ standby_recv_timeout = atoi(optarg)*1000;
+ if (standby_recv_timeout < 0)
+ {
+ fprintf(stderr, _("%s: invalid recv timeout \"%s\"\n"),
+ progname, optarg);
+ exit(1);
+ }
+ break;
+ case 't':
+ if (atoi(optarg) < 0)
+ {
+ fprintf(stderr, _("%s: invalid connect timeout \"%s\"\n"),
+ progname, optarg);
+ exit(1);
+ }
+
+ standby_connect_timeout = pg_strdup(optarg);
+ break;
+
case 'n':
noloop = 1;
break;
*** a/src/bin/pg_basebackup/receivelog.c
--- b/src/bin/pg_basebackup/receivelog.c
***************
*** 181,187 **** close_walfile(char *basedir, char *walname, bool segment_complete)
* backend code. The protocol always uses integer timestamps, regardless of
* server setting.
*/
! static int64
localGetCurrentTimestamp(void)
{
int64 result;
--- 181,187 ----
* backend code. The protocol always uses integer timestamps, regardless of
* server setting.
*/
! int64
localGetCurrentTimestamp(void)
{
int64 result;
***************
*** 201,207 **** localGetCurrentTimestamp(void)
* Local version of TimestampDifference(), since we are not linked with
* backend code.
*/
! static void
localTimestampDifference(int64 start_time, int64 stop_time,
long *secs, int *microsecs)
{
--- 201,207 ----
* Local version of TimestampDifference(), since we are not linked with
* backend code.
*/
! void
localTimestampDifference(int64 start_time, int64 stop_time,
long *secs, int *microsecs)
{
***************
*** 223,229 **** localTimestampDifference(int64 start_time, int64 stop_time,
* Local version of TimestampDifferenceExceeds(), since we are not
* linked with backend code.
*/
! static bool
localTimestampDifferenceExceeds(int64 start_time,
int64 stop_time,
int msec)
--- 223,229 ----
* Local version of TimestampDifferenceExceeds(), since we are not
* linked with backend code.
*/
! bool
localTimestampDifferenceExceeds(int64 start_time,
int64 stop_time,
int msec)
***************
*** 333,339 **** bool
ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
char *sysidentifier, char *basedir,
stream_stop_callback stream_stop,
! int standby_message_timeout, bool rename_partial)
{
char query[128];
char current_walfile_name[MAXPGPATH];
--- 333,340 ----
ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
char *sysidentifier, char *basedir,
stream_stop_callback stream_stop,
! int standby_message_timeout,
! int standby_recv_timeout, bool rename_partial)
{
char query[128];
char current_walfile_name[MAXPGPATH];
***************
*** 341,346 **** ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
--- 342,349 ----
char *copybuf = NULL;
int64 last_status = -1;
XLogRecPtr blockpos = InvalidXLogRecPtr;
+ int64 last_recv_timestamp;
+ bool ping_sent = false;
if (sysidentifier != NULL)
{
***************
*** 394,399 **** ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
--- 397,406 ----
}
PQclear(res);
+ /* Set the last reply timestamp */
+ last_recv_timestamp = localGetCurrentTimestamp();
+ ping_sent = false;
+
/*
* Receive the actual xlog data
*/
***************
*** 477,486 **** ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
if (r == 0 || (r < 0 && errno == EINTR))
{
/*
! * Got a timeout or signal. Continue the loop and either
! * deliver a status packet to the server or just go back into
* blocking.
*/
continue;
}
else if (r < 0)
--- 484,522 ----
if (r == 0 || (r < 0 && errno == EINTR))
{
/*
! * Got a timeout or signal. Before Continuing the loop, check for timeout.
! * and then either deliver a status packet to the server or just go back into
* blocking.
*/
+ if (standby_recv_timeout > 0)
+ {
+ now = localGetCurrentTimestamp();
+ if (localTimestampDifferenceExceeds(last_recv_timestamp, now, standby_recv_timeout))
+ {
+ fprintf(stderr, _("%s: terminating XLogStream receiver due to timeout\n"),
+ progname);
+ goto error;
+ }
+
+ /*
+ * We didn't receive anything new, for half of receiver
+ * replication timeout. Ping the server, if not already done.
+ */
+ if (!ping_sent)
+ {
+ if (localTimestampDifferenceExceeds(last_recv_timestamp, now, (standby_recv_timeout/2)))
+ {
+ if (!sendFeedback(conn, blockpos, now, true))
+ {
+ goto error;
+ }
+
+ last_status = now;
+ ping_sent = true;
+ }
+ }
+ }
+
continue;
}
else if (r < 0)
***************
*** 497,502 **** ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
--- 533,543 ----
progname, PQerrorMessage(conn));
goto error;
}
+
+ /* Set the last reply timestamp */
+ last_recv_timestamp = localGetCurrentTimestamp();
+ ping_sent = false;
+
continue;
}
if (r == -1)
***************
*** 509,514 **** ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
--- 550,559 ----
goto error;
}
+ /* Set the last reply timestamp */
+ last_recv_timestamp = localGetCurrentTimestamp();
+ ping_sent = false;
+
/* Check the message type. */
if (copybuf[0] == 'k')
{
*** a/src/bin/pg_basebackup/receivelog.h
--- b/src/bin/pg_basebackup/receivelog.h
***************
*** 7,16 ****
typedef bool (*stream_stop_callback) (XLogRecPtr segendpos, uint32 timeline, bool segment_finished);
extern bool ReceiveXlogStream(PGconn *conn,
! XLogRecPtr startpos,
! uint32 timeline,
! char *sysidentifier,
! char *basedir,
! stream_stop_callback stream_stop,
! int standby_message_timeout,
! bool rename_partial);
--- 7,24 ----
typedef bool (*stream_stop_callback) (XLogRecPtr segendpos, uint32 timeline, bool segment_finished);
extern bool ReceiveXlogStream(PGconn *conn,
! XLogRecPtr startpos,
! uint32 timeline,
! char *sysidentifier,
! char *basedir,
! stream_stop_callback stream_stop,
! int standby_message_timeout,
! int standby_recv_timeout,
! bool rename_partial);
!
! extern int64 localGetCurrentTimestamp(void);
! extern void localTimestampDifference(int64 start_time, int64 stop_time,
! long *secs, int *microsecs);
! extern bool localTimestampDifferenceExceeds(int64 start_time,
! int64 stop_time,
! int msec);
*** a/src/bin/pg_basebackup/streamutil.c
--- b/src/bin/pg_basebackup/streamutil.c
***************
*** 66,74 **** pg_malloc0(size_t size)
* Connect to the server. Returns a valid PGconn pointer if connected,
* or NULL on non-permanent error. On permanent error, the function will
* call exit(1) directly.
*/
PGconn *
! GetConnection(void)
{
PGconn *tmpconn;
int argcount = 4; /* dbname, replication, fallback_app_name,
--- 66,76 ----
* Connect to the server. Returns a valid PGconn pointer if connected,
* or NULL on non-permanent error. On permanent error, the function will
* call exit(1) directly.
+ * Set conn_timeout to PGconn structure if their value
+ * is not NULL.
*/
PGconn *
! GetConnection(char *conn_timeout)
{
PGconn *tmpconn;
int argcount = 4; /* dbname, replication, fallback_app_name,
***************
*** 85,90 **** GetConnection(void)
--- 87,94 ----
argcount++;
if (dbport)
argcount++;
+ if (conn_timeout)
+ argcount++;
keywords = pg_malloc0((argcount + 1) * sizeof(*keywords));
values = pg_malloc0((argcount + 1) * sizeof(*values));
***************
*** 114,119 **** GetConnection(void)
--- 118,129 ----
values[i] = dbport;
i++;
}
+ if (conn_timeout != NULL)
+ {
+ keywords[i] = "connect_timeout";
+ values[i] = conn_timeout;
+ i++;
+ }
while (true)
{
*** a/src/bin/pg_basebackup/streamutil.h
--- b/src/bin/pg_basebackup/streamutil.h
***************
*** 19,22 **** extern PGconn *conn;
extern char *pg_strdup(const char *s);
extern void *pg_malloc0(size_t size);
! extern PGconn *GetConnection(void);
--- 19,22 ----
extern char *pg_strdup(const char *s);
extern void *pg_malloc0(size_t size);
! PGconn *GetConnection(char *conn_timeout);
=
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Review of "pg_basebackup and pg_receivexlog to use non-blocking socket communication", was: Re: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
@ 2013-01-07 14:23 Boszormenyi Zoltan <zb@cybertec.at>
parent: Boszormenyi Zoltan <zb@cybertec.at>
3 siblings, 3 replies; 11+ messages in thread
From: Boszormenyi Zoltan @ 2013-01-07 14:23 UTC (permalink / raw)
To: Hari Babu <haribabu.kommi@huawei.com>; +Cc: Fujii Masao <masao.fujii@gmail.com>; Heikki Linnakangas <hlinnakangas@vmware.com>; pgsql-hackers@postgresql.org; Amit kapila <amit.kapila@huawei.com>
2013-01-04 13:43 keltezéssel, Hari Babu írta:
> On January 02, 2013 12:41 PM Hari Babu wrote:
>> On January 01, 2013 10:19 PM Boszormenyi Zoltan wrote:
>>> I am reviewing your patch.
>>> • Is the patch in context diff format?
>>> Yes.
>> Thanks for reviewing the patch.
>>
>>> • Does it apply cleanly to the current git master?
>>> Not quite cleanly but it doesn't produce rejects or fuzz, only offset
> warnings:
>> Will rebase the patch to head.
>>
>>> • Does it include reasonable tests, necessary doc patches, etc?
>>> The test cases are not applicable. There is no test framework for
>>> testing network outage in "make check".
>>>
>>> There are no documentation patches for the new --recvtimeout=INTERVAL
>>> and --conntimeout=INTERVAL options for either pg_basebackup or
>>> pg_receivexlog.
>> I will add the documentation for the same.
>>
>>> Per the previous comment, no. But those are for the backend
>>> to notice network breakdowns and as such, they need a
>>> separate patch.
>> I also think it is better to handle it as a separate patch for walsender.
>>
>>> • Are the comments sufficient and accurate?
>>> This chunk below removes a comment which seems obvious enough
>>> so it's not needed:
>>> ***************
>>> *** 518,524 **** ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos,
> uint32 timeline,
>>> goto error;
>>> }
>>>
>>> ! /* Check the message type. */
>>> if (copybuf[0] == 'k')
>>> {
>>> int pos;
>>> --- 559,568 ----
>>> goto error;
>>> }
>>>
>>> ! /* Set the last reply timestamp */
>>> ! last_recv_timestamp = localGetCurrentTimestamp();
>>> ! ping_sent = false;
>>> !
>>> if (copybuf[0] == 'k')
>>> {
>>> int pos;
>>> ***************
>>>
>>> Other comments are sufficient and accurate.
>> I will fix and update the patch.
> The attached V2 patch in the mail handles all the review comments identified
> above.
>
> Regards,
> Hari babu.
Since my other patch against pg_basebackup is now committed,
this patch doesn't apply cleanly, patch rejects 2 hunks.
The fixed up patch is attached.
Best regards,
Zoltán Böszörményi
--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
http://www.postgresql.at/
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
pg_basebkup_recvxlog_noblock_comm_v3.patch (text/x-patch, 25.6K) download
diff -dcrpN postgresql.orig/doc/src/sgml/ref/pg_basebackup.sgml postgresql/doc/src/sgml/ref/pg_basebackup.sgml
*** postgresql.orig/doc/src/sgml/ref/pg_basebackup.sgml 2013-01-05 17:34:30.742135371 +0100
--- postgresql/doc/src/sgml/ref/pg_basebackup.sgml 2013-01-07 15:11:40.787007890 +0100
*************** PostgreSQL documentation
*** 400,405 ****
--- 400,425 ----
</varlistentry>
<varlistentry>
+ <term><option>-r <replaceable class="parameter">interval</replaceable></option></term>
+ <term><option>--recvtimeout=<replaceable class="parameter">interval</replaceable></option></term>
+ <listitem>
+ <para>
+ time that receiver waits for communication from server (in seconds).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-t <replaceable class="parameter">interval</replaceable></option></term>
+ <term><option>--conntimeout=<replaceable class="parameter">interval</replaceable></option></term>
+ <listitem>
+ <para>
+ time that client wait for connection to establish with server (in seconds).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-U <replaceable>username</replaceable></option></term>
<term><option>--username=<replaceable class="parameter">username</replaceable></option></term>
<listitem>
diff -dcrpN postgresql.orig/doc/src/sgml/ref/pg_receivexlog.sgml postgresql/doc/src/sgml/ref/pg_receivexlog.sgml
*** postgresql.orig/doc/src/sgml/ref/pg_receivexlog.sgml 2012-11-08 13:13:04.152630639 +0100
--- postgresql/doc/src/sgml/ref/pg_receivexlog.sgml 2013-01-07 15:11:40.788007898 +0100
*************** PostgreSQL documentation
*** 164,169 ****
--- 164,189 ----
</varlistentry>
<varlistentry>
+ <term><option>-r <replaceable class="parameter">interval</replaceable></option></term>
+ <term><option>--recvtimeout=<replaceable class="parameter">interval</replaceable></option></term>
+ <listitem>
+ <para>
+ time that receiver waits for communication from server (in seconds).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>-t <replaceable class="parameter">interval</replaceable></option></term>
+ <term><option>--conntimeout=<replaceable class="parameter">interval</replaceable></option></term>
+ <listitem>
+ <para>
+ time that client wait for connection to establish with server (in seconds).
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-U <replaceable>username</replaceable></option></term>
<term><option>--username=<replaceable class="parameter">username</replaceable></option></term>
<listitem>
diff -dcrpN postgresql.orig/src/bin/pg_basebackup/pg_basebackup.c postgresql/src/bin/pg_basebackup/pg_basebackup.c
*** postgresql.orig/src/bin/pg_basebackup/pg_basebackup.c 2013-01-05 17:34:30.778135625 +0100
--- postgresql/src/bin/pg_basebackup/pg_basebackup.c 2013-01-07 15:16:24.610037886 +0100
*************** bool streamwal = false;
*** 45,50 ****
--- 45,54 ----
bool fastcheckpoint = false;
bool writerecoveryconf = false;
int standby_message_timeout = 10 * 1000; /* 10 sec = default */
+ int standby_recv_timeout = 60*1000; /* 60 sec = default */
+ char *standby_connect_timeout = NULL;
+
+ #define NAPTIME_PER_CYCLE 100 /* max sleep time between cycles (100ms) */
/* Progress counters */
static uint64 totalsize;
*************** usage(void)
*** 130,135 ****
--- 134,143 ----
printf(_(" -p, --port=PORT database server port number\n"));
printf(_(" -s, --status-interval=INTERVAL\n"
" time between status packets sent to server (in seconds)\n"));
+ printf(_(" -r, --recvtimeout=INTERVAL time that receiver waits for communication from\n"
+ " server (in seconds)\n"));
+ printf(_(" -t, --conntimeout=INTERVAL time that client wait for connection to establish\n"
+ " with server (in seconds)\n"));
printf(_(" -U, --username=NAME connect as specified database user\n"));
printf(_(" -w, --no-password never prompt for password\n"));
printf(_(" -W, --password force password prompt (should happen automatically)\n"));
*************** LogStreamerMain(logstreamer_param *param
*** 242,249 ****
{
if (!ReceiveXlogStream(param->bgconn, param->startptr, param->timeline,
param->sysidentifier, param->xlogdir,
! reached_end_position, standby_message_timeout,
! true))
/*
* Any errors will already have been reported in the function process,
--- 250,257 ----
{
if (!ReceiveXlogStream(param->bgconn, param->startptr, param->timeline,
param->sysidentifier, param->xlogdir,
! reached_end_position, standby_message_timeout,
! standby_recv_timeout, true))
/*
* Any errors will already have been reported in the function process,
*************** StartLogStreamer(char *startpos, uint32
*** 295,302 ****
}
#endif
! /* Get a second connection */
! param->bgconn = GetConnection();
if (!param->bgconn)
/* Error message already written in GetConnection() */
exit(1);
--- 303,311 ----
}
#endif
! /* Get a second connection. Sending connect_timeout
! * as configured, there is no need for rw_timeout.*/
! param->bgconn = GetConnection(standby_connect_timeout);
if (!param->bgconn)
/* Error message already written in GetConnection() */
exit(1);
*************** ReceiveTarFile(PGconn *conn, PGresult *r
*** 511,516 ****
--- 520,526 ----
char filename[MAXPGPATH];
char *copybuf = NULL;
FILE *tarfile = NULL;
+ int64 last_recv_timestamp;
char tarhdr[512];
bool basetablespace = PQgetisnull(res, rownum, 0);
bool in_tarhdr = true;
*************** ReceiveTarFile(PGconn *conn, PGresult *r
*** 634,642 ****
--- 644,655 ----
disconnect_and_exit(1);
}
+ /* Set the last reply timestamp */
+ last_recv_timestamp = localGetCurrentTimestamp();
while (1)
{
int r;
+ int64 now;
if (copybuf != NULL)
{
*************** ReceiveTarFile(PGconn *conn, PGresult *r
*** 644,650 ****
copybuf = NULL;
}
! r = PQgetCopyData(conn, ©buf, 0);
if (r == -1)
{
/*
--- 657,718 ----
copybuf = NULL;
}
! r = PQgetCopyData(conn, ©buf, 1);
! if (r == 0)
! {
! /*
! * In async mode, and no data available. We block on reading but
! * not more than the specified timeout, so that we can send a
! * response back to the client.
! */
! fd_set input_mask;
! struct timeval timeout;
!
! FD_ZERO(&input_mask);
! FD_SET(PQsocket(conn), &input_mask);
! timeout.tv_sec = 0;
! timeout.tv_usec = NAPTIME_PER_CYCLE*1000;
!
! r = select(PQsocket(conn) + 1, &input_mask, NULL, NULL, &timeout);
! if (r == 0 || (r < 0 && errno == EINTR))
! {
! /*
! * Got a timeout or signal. Before Continuing the loop, check for timeout.
! */
! if (standby_recv_timeout > 0)
! {
! now = localGetCurrentTimestamp();
! if (localTimestampDifferenceExceeds(last_recv_timestamp, now, standby_recv_timeout))
! {
! fprintf(stderr, _("%s: terminating DB File receive due to timeout\n"),
! progname);
! disconnect_and_exit(1);
! }
! }
!
! continue;
! }
! else if (r < 0)
! {
! fprintf(stderr, _("%s: select() failed: %s\n"),
! progname, strerror(errno));
! disconnect_and_exit(1);
! }
! /* Else there is actually data on the socket */
! if (PQconsumeInput(conn) == 0)
! {
! fprintf(stderr,
! _("%s: could not receive data from WAL Sender: %s"),
! progname, PQerrorMessage(conn));
! disconnect_and_exit(1);
! }
!
! /* Set the last reply timestamp */
! last_recv_timestamp = localGetCurrentTimestamp();
!
! /* Some data is received, so go back read them in buffer*/
! continue;
! }
if (r == -1)
{
/*
*************** ReceiveTarFile(PGconn *conn, PGresult *r
*** 680,685 ****
--- 748,756 ----
/* 2 * 512 bytes empty data at end of file */
WRITE_TAR_DATA(zerobuf, sizeof(zerobuf));
+ /* Set the last reply timestamp */
+ last_recv_timestamp = localGetCurrentTimestamp();
+
#ifdef HAVE_LIBZ
if (ztarfile != NULL)
{
*************** ReceiveAndUnpackTarFile(PGconn *conn, PG
*** 860,865 ****
--- 931,937 ----
bool basetablespace = PQgetisnull(res, rownum, 0);
char *copybuf = NULL;
FILE *file = NULL;
+ int64 last_recv_timestamp;
if (basetablespace)
strcpy(current_path, basedir);
*************** ReceiveAndUnpackTarFile(PGconn *conn, PG
*** 877,885 ****
--- 949,961 ----
disconnect_and_exit(1);
}
+ /* Set the last reply timestamp */
+ last_recv_timestamp = localGetCurrentTimestamp();
while (1)
{
int r;
+ int64 now;
+
if (copybuf != NULL)
{
*************** ReceiveAndUnpackTarFile(PGconn *conn, PG
*** 887,894 ****
copybuf = NULL;
}
! r = PQgetCopyData(conn, ©buf, 0);
if (r == -1)
{
/*
--- 963,1024 ----
copybuf = NULL;
}
! r = PQgetCopyData(conn, ©buf, 1);
! if (r == 0)
! {
! /*
! * In async mode, and no data available. We block on reading but
! * not more than the specified timeout, so that we can send a
! * response back to the client.
! */
! fd_set input_mask;
! struct timeval timeout;
!
! FD_ZERO(&input_mask);
! FD_SET(PQsocket(conn), &input_mask);
! timeout.tv_sec = 0;
! timeout.tv_usec = NAPTIME_PER_CYCLE*1000;
+ r = select(PQsocket(conn) + 1, &input_mask, NULL, NULL, &timeout);
+ if (r == 0 || (r < 0 && errno == EINTR))
+ {
+ /*
+ * Got a timeout or signal. Before Continuing the loop, check for timeout.
+ */
+ if (standby_recv_timeout > 0)
+ {
+ now = localGetCurrentTimestamp();
+ if (localTimestampDifferenceExceeds(last_recv_timestamp, now, standby_recv_timeout))
+ {
+ fprintf(stderr, _("%s: terminating DB File receive due to timeout\n"),
+ progname);
+ disconnect_and_exit(1);
+ }
+ }
+
+ continue;
+ }
+ else if (r < 0)
+ {
+ fprintf(stderr, _("%s: select() failed: %s\n"),
+ progname, strerror(errno));
+ disconnect_and_exit(1);
+ }
+ /* Else there is actually data on the socket */
+ if (PQconsumeInput(conn) == 0)
+ {
+ fprintf(stderr,
+ _("%s: could not receive data from WAL Sender: %s"),
+ progname, PQerrorMessage(conn));
+ disconnect_and_exit(1);
+ }
+
+ /* Set the last reply timestamp */
+ last_recv_timestamp = localGetCurrentTimestamp();
+
+ /* Some data is received, so go back read them in buffer*/
+ continue;
+ }
if (r == -1)
{
/*
*************** ReceiveAndUnpackTarFile(PGconn *conn, PG
*** 901,911 ****
}
else if (r == -2)
{
fprintf(stderr, _("%s: could not read COPY data: %s"),
progname, PQerrorMessage(conn));
disconnect_and_exit(1);
}
!
if (file == NULL)
{
int filemode;
--- 1031,1044 ----
}
else if (r == -2)
{
+ fprintf(stderr, "\n");
fprintf(stderr, _("%s: could not read COPY data: %s"),
progname, PQerrorMessage(conn));
disconnect_and_exit(1);
}
!
! /* Set the last reply timestamp */
! last_recv_timestamp = localGetCurrentTimestamp();
if (file == NULL)
{
int filemode;
*************** BaseBackup(void)
*** 1213,1221 ****
char xlogend[64];
/*
! * Connect in replication mode to the server
*/
! conn = GetConnection();
if (!conn)
/* Error message already written in GetConnection() */
exit(1);
--- 1346,1354 ----
char xlogend[64];
/*
! * Connect in replication mode to the server. Sending connect_timeout.
*/
! conn = GetConnection(standby_connect_timeout);
if (!conn)
/* Error message already written in GetConnection() */
exit(1);
*************** main(int argc, char **argv)
*** 1524,1529 ****
--- 1657,1664 ----
{"no-password", no_argument, NULL, 'w'},
{"password", no_argument, NULL, 'W'},
{"status-interval", required_argument, NULL, 's'},
+ {"recvtimeout", required_argument, NULL, 'r'},
+ {"conntimeout", required_argument, NULL, 't'},
{"verbose", no_argument, NULL, 'v'},
{"progress", no_argument, NULL, 'P'},
{NULL, 0, NULL, 0}
*************** main(int argc, char **argv)
*** 1550,1556 ****
}
}
! while ((c = getopt_long(argc, argv, "D:F:RxX:l:zZ:c:h:p:U:s:wWvP",
long_options, &option_index)) != -1)
{
switch (c)
--- 1685,1691 ----
}
}
! while ((c = getopt_long(argc, argv, "D:F:RxX:l:zZ:c:h:p:U:s:r:t:wWvP",
long_options, &option_index)) != -1)
{
switch (c)
*************** main(int argc, char **argv)
*** 1665,1670 ****
--- 1800,1825 ----
exit(1);
}
break;
+ case 'r':
+ standby_recv_timeout = atoi(optarg)*1000;
+ if (standby_recv_timeout < 0)
+ {
+ fprintf(stderr, _("%s: invalid recv timeout \"%s\"\n"),
+ progname, optarg);
+ exit(1);
+ }
+
+ break;
+ case 't':
+ if (atoi(optarg) < 0)
+ {
+ fprintf(stderr, _("%s: invalid connect timeout \"%s\"\n"),
+ progname, optarg);
+ exit(1);
+ }
+
+ standby_connect_timeout = pg_strdup(optarg);
+ break;
case 'v':
verbose++;
break;
diff -dcrpN postgresql.orig/src/bin/pg_basebackup/pg_receivexlog.c postgresql/src/bin/pg_basebackup/pg_receivexlog.c
*** postgresql.orig/src/bin/pg_basebackup/pg_receivexlog.c 2013-01-02 09:19:03.856521815 +0100
--- postgresql/src/bin/pg_basebackup/pg_receivexlog.c 2013-01-07 15:11:40.792007931 +0100
*************** char *basedir = NULL;
*** 35,40 ****
--- 35,42 ----
int verbose = 0;
int noloop = 0;
int standby_message_timeout = 10 * 1000; /* 10 sec = default */
+ int standby_recv_timeout = 60*1000; /* 60 sec = default */
+ char *standby_connect_timeout = NULL;
volatile bool time_to_abort = false;
*************** usage(void)
*** 63,68 ****
--- 65,74 ----
printf(_(" -p, --port=PORT database server port number\n"));
printf(_(" -s, --status-interval=INTERVAL\n"
" time between status packets sent to server (in seconds)\n"));
+ printf(_(" -r, --recvtimeout=INTERVAL time that receiver waits for communication from\n"
+ " server (in seconds)\n"));
+ printf(_(" -t, --conntimeout=INTERVAL time that client wait for connection to establish\n"
+ " with server (in seconds)\n"));
printf(_(" -U, --username=NAME connect as specified database user\n"));
printf(_(" -w, --no-password never prompt for password\n"));
printf(_(" -W, --password force password prompt (should happen automatically)\n"));
*************** StreamLog(void)
*** 218,226 ****
lo;
/*
! * Connect in replication mode to the server
*/
! conn = GetConnection();
if (!conn)
/* Error message already written in GetConnection() */
return;
--- 224,233 ----
lo;
/*
! * Connect in replication mode to the server, Sending connect_timeout
! * as configured, there is no need for rw_timeout.
*/
! conn = GetConnection(standby_connect_timeout);
if (!conn)
/* Error message already written in GetConnection() */
return;
*************** StreamLog(void)
*** 274,280 ****
timeline);
ReceiveXlogStream(conn, startpos, timeline, NULL, basedir,
! stop_streaming, standby_message_timeout, false);
PQfinish(conn);
}
--- 281,288 ----
timeline);
ReceiveXlogStream(conn, startpos, timeline, NULL, basedir,
! stop_streaming, standby_message_timeout,
! standby_recv_timeout, false);
PQfinish(conn);
}
*************** main(int argc, char **argv)
*** 306,311 ****
--- 314,321 ----
{"no-password", no_argument, NULL, 'w'},
{"password", no_argument, NULL, 'W'},
{"status-interval", required_argument, NULL, 's'},
+ {"recvtimeout", required_argument, NULL, 'r'},
+ {"conntimeout", required_argument, NULL, 't'},
{"verbose", no_argument, NULL, 'v'},
{NULL, 0, NULL, 0}
};
*************** main(int argc, char **argv)
*** 331,337 ****
}
}
! while ((c = getopt_long(argc, argv, "D:h:p:U:s:nwWv",
long_options, &option_index)) != -1)
{
switch (c)
--- 341,347 ----
}
}
! while ((c = getopt_long(argc, argv, "D:h:p:U:s:r:t:nwWv",
long_options, &option_index)) != -1)
{
switch (c)
*************** main(int argc, char **argv)
*** 369,374 ****
--- 379,404 ----
exit(1);
}
break;
+ case 'r':
+ standby_recv_timeout = atoi(optarg)*1000;
+ if (standby_recv_timeout < 0)
+ {
+ fprintf(stderr, _("%s: invalid recv timeout \"%s\"\n"),
+ progname, optarg);
+ exit(1);
+ }
+ break;
+ case 't':
+ if (atoi(optarg) < 0)
+ {
+ fprintf(stderr, _("%s: invalid connect timeout \"%s\"\n"),
+ progname, optarg);
+ exit(1);
+ }
+
+ standby_connect_timeout = pg_strdup(optarg);
+ break;
+
case 'n':
noloop = 1;
break;
diff -dcrpN postgresql.orig/src/bin/pg_basebackup/receivelog.c postgresql/src/bin/pg_basebackup/receivelog.c
*** postgresql.orig/src/bin/pg_basebackup/receivelog.c 2013-01-02 09:19:03.856521815 +0100
--- postgresql/src/bin/pg_basebackup/receivelog.c 2013-01-07 15:11:40.792007931 +0100
*************** close_walfile(char *basedir, char *walna
*** 181,187 ****
* backend code. The protocol always uses integer timestamps, regardless of
* server setting.
*/
! static int64
localGetCurrentTimestamp(void)
{
int64 result;
--- 181,187 ----
* backend code. The protocol always uses integer timestamps, regardless of
* server setting.
*/
! int64
localGetCurrentTimestamp(void)
{
int64 result;
*************** localGetCurrentTimestamp(void)
*** 201,207 ****
* Local version of TimestampDifference(), since we are not linked with
* backend code.
*/
! static void
localTimestampDifference(int64 start_time, int64 stop_time,
long *secs, int *microsecs)
{
--- 201,207 ----
* Local version of TimestampDifference(), since we are not linked with
* backend code.
*/
! void
localTimestampDifference(int64 start_time, int64 stop_time,
long *secs, int *microsecs)
{
*************** localTimestampDifference(int64 start_tim
*** 223,229 ****
* Local version of TimestampDifferenceExceeds(), since we are not
* linked with backend code.
*/
! static bool
localTimestampDifferenceExceeds(int64 start_time,
int64 stop_time,
int msec)
--- 223,229 ----
* Local version of TimestampDifferenceExceeds(), since we are not
* linked with backend code.
*/
! bool
localTimestampDifferenceExceeds(int64 start_time,
int64 stop_time,
int msec)
*************** bool
*** 333,339 ****
ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
char *sysidentifier, char *basedir,
stream_stop_callback stream_stop,
! int standby_message_timeout, bool rename_partial)
{
char query[128];
char current_walfile_name[MAXPGPATH];
--- 333,340 ----
ReceiveXlogStream(PGconn *conn, XLogRecPtr startpos, uint32 timeline,
char *sysidentifier, char *basedir,
stream_stop_callback stream_stop,
! int standby_message_timeout,
! int standby_recv_timeout, bool rename_partial)
{
char query[128];
char current_walfile_name[MAXPGPATH];
*************** ReceiveXlogStream(PGconn *conn, XLogRecP
*** 341,346 ****
--- 342,349 ----
char *copybuf = NULL;
int64 last_status = -1;
XLogRecPtr blockpos = InvalidXLogRecPtr;
+ int64 last_recv_timestamp;
+ bool ping_sent = false;
if (sysidentifier != NULL)
{
*************** ReceiveXlogStream(PGconn *conn, XLogRecP
*** 394,399 ****
--- 397,406 ----
}
PQclear(res);
+ /* Set the last reply timestamp */
+ last_recv_timestamp = localGetCurrentTimestamp();
+ ping_sent = false;
+
/*
* Receive the actual xlog data
*/
*************** ReceiveXlogStream(PGconn *conn, XLogRecP
*** 477,486 ****
if (r == 0 || (r < 0 && errno == EINTR))
{
/*
! * Got a timeout or signal. Continue the loop and either
! * deliver a status packet to the server or just go back into
* blocking.
*/
continue;
}
else if (r < 0)
--- 484,522 ----
if (r == 0 || (r < 0 && errno == EINTR))
{
/*
! * Got a timeout or signal. Before Continuing the loop, check for timeout.
! * and then either deliver a status packet to the server or just go back into
* blocking.
*/
+ if (standby_recv_timeout > 0)
+ {
+ now = localGetCurrentTimestamp();
+ if (localTimestampDifferenceExceeds(last_recv_timestamp, now, standby_recv_timeout))
+ {
+ fprintf(stderr, _("%s: terminating XLogStream receiver due to timeout\n"),
+ progname);
+ goto error;
+ }
+
+ /*
+ * We didn't receive anything new, for half of receiver
+ * replication timeout. Ping the server, if not already done.
+ */
+ if (!ping_sent)
+ {
+ if (localTimestampDifferenceExceeds(last_recv_timestamp, now, (standby_recv_timeout/2)))
+ {
+ if (!sendFeedback(conn, blockpos, now, true))
+ {
+ goto error;
+ }
+
+ last_status = now;
+ ping_sent = true;
+ }
+ }
+ }
+
continue;
}
else if (r < 0)
*************** ReceiveXlogStream(PGconn *conn, XLogRecP
*** 497,502 ****
--- 533,543 ----
progname, PQerrorMessage(conn));
goto error;
}
+
+ /* Set the last reply timestamp */
+ last_recv_timestamp = localGetCurrentTimestamp();
+ ping_sent = false;
+
continue;
}
if (r == -1)
*************** ReceiveXlogStream(PGconn *conn, XLogRecP
*** 509,514 ****
--- 550,559 ----
goto error;
}
+ /* Set the last reply timestamp */
+ last_recv_timestamp = localGetCurrentTimestamp();
+ ping_sent = false;
+
/* Check the message type. */
if (copybuf[0] == 'k')
{
diff -dcrpN postgresql.orig/src/bin/pg_basebackup/receivelog.h postgresql/src/bin/pg_basebackup/receivelog.h
*** postgresql.orig/src/bin/pg_basebackup/receivelog.h 2012-06-11 06:22:48.200921787 +0200
--- postgresql/src/bin/pg_basebackup/receivelog.h 2013-01-07 15:11:40.793007938 +0100
***************
*** 7,16 ****
typedef bool (*stream_stop_callback) (XLogRecPtr segendpos, uint32 timeline, bool segment_finished);
extern bool ReceiveXlogStream(PGconn *conn,
! XLogRecPtr startpos,
! uint32 timeline,
! char *sysidentifier,
! char *basedir,
! stream_stop_callback stream_stop,
! int standby_message_timeout,
! bool rename_partial);
--- 7,24 ----
typedef bool (*stream_stop_callback) (XLogRecPtr segendpos, uint32 timeline, bool segment_finished);
extern bool ReceiveXlogStream(PGconn *conn,
! XLogRecPtr startpos,
! uint32 timeline,
! char *sysidentifier,
! char *basedir,
! stream_stop_callback stream_stop,
! int standby_message_timeout,
! int standby_recv_timeout,
! bool rename_partial);
!
! extern int64 localGetCurrentTimestamp(void);
! extern void localTimestampDifference(int64 start_time, int64 stop_time,
! long *secs, int *microsecs);
! extern bool localTimestampDifferenceExceeds(int64 start_time,
! int64 stop_time,
! int msec);
diff -dcrpN postgresql.orig/src/bin/pg_basebackup/streamutil.c postgresql/src/bin/pg_basebackup/streamutil.c
*** postgresql.orig/src/bin/pg_basebackup/streamutil.c 2013-01-02 09:19:03.856521815 +0100
--- postgresql/src/bin/pg_basebackup/streamutil.c 2013-01-07 15:11:40.793007938 +0100
*************** pg_malloc0(size_t size)
*** 66,74 ****
* Connect to the server. Returns a valid PGconn pointer if connected,
* or NULL on non-permanent error. On permanent error, the function will
* call exit(1) directly.
*/
PGconn *
! GetConnection(void)
{
PGconn *tmpconn;
int argcount = 4; /* dbname, replication, fallback_app_name,
--- 66,76 ----
* Connect to the server. Returns a valid PGconn pointer if connected,
* or NULL on non-permanent error. On permanent error, the function will
* call exit(1) directly.
+ * Set conn_timeout to PGconn structure if their value
+ * is not NULL.
*/
PGconn *
! GetConnection(char *conn_timeout)
{
PGconn *tmpconn;
int argcount = 4; /* dbname, replication, fallback_app_name,
*************** GetConnection(void)
*** 85,90 ****
--- 87,94 ----
argcount++;
if (dbport)
argcount++;
+ if (conn_timeout)
+ argcount++;
keywords = pg_malloc0((argcount + 1) * sizeof(*keywords));
values = pg_malloc0((argcount + 1) * sizeof(*values));
*************** GetConnection(void)
*** 114,119 ****
--- 118,129 ----
values[i] = dbport;
i++;
}
+ if (conn_timeout != NULL)
+ {
+ keywords[i] = "connect_timeout";
+ values[i] = conn_timeout;
+ i++;
+ }
while (true)
{
diff -dcrpN postgresql.orig/src/bin/pg_basebackup/streamutil.h postgresql/src/bin/pg_basebackup/streamutil.h
*** postgresql.orig/src/bin/pg_basebackup/streamutil.h 2012-10-03 10:40:48.299207401 +0200
--- postgresql/src/bin/pg_basebackup/streamutil.h 2013-01-07 15:11:40.794007945 +0100
*************** extern PGconn *conn;
*** 19,22 ****
extern char *pg_strdup(const char *s);
extern void *pg_malloc0(size_t size);
! extern PGconn *GetConnection(void);
--- 19,22 ----
extern char *pg_strdup(const char *s);
extern void *pg_malloc0(size_t size);
! PGconn *GetConnection(char *conn_timeout);
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Review of "pg_basebackup and pg_receivexlog to use non-blocking socket communication", was: Re: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
@ 2013-01-09 04:02 Hari Babu <haribabu.kommi@huawei.com>
parent: Boszormenyi Zoltan <zb@cybertec.at>
3 siblings, 0 replies; 11+ messages in thread
From: Hari Babu @ 2013-01-09 04:02 UTC (permalink / raw)
To: 'Boszormenyi Zoltan' <zb@cybertec.at>; +Cc: 'Fujii Masao' <masao.fujii@gmail.com>; 'Heikki Linnakangas' <hlinnakangas@vmware.com>; pgsql-hackers@postgresql.org; 'Amit kapila' <amit.kapila@huawei.com>
On January 07, 2013 7:53 PM Boszormenyi Zoltan wrote:
>Since my other patch against pg_basebackup is now committed,
>this patch doesn't apply cleanly, patch rejects 2 hunks.
>The fixed up patch is attached.
Patch is verified. Thanks for rebasing the patch.
Regards,
Hari babu.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Review of "pg_basebackup and pg_receivexlog to use non-blocking socket communication", was: Re: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
@ 2013-01-16 07:48 Abhijit Menon-Sen <ams@2ndQuadrant.com>
parent: Boszormenyi Zoltan <zb@cybertec.at>
2 siblings, 0 replies; 11+ messages in thread
From: Abhijit Menon-Sen @ 2013-01-16 07:48 UTC (permalink / raw)
To: pgsql-hackers@postgresql.org; +Cc: Boszormenyi Zoltan <zb@cybertec.at>; Hari Babu <haribabu.kommi@huawei.com>; Fujii Masao <masao.fujii@gmail.com>; Heikki Linnakangas <hlinnakangas@vmware.com>; Amit kapila <amit.kapila@huawei.com>
Hi.
This patch was marked "Needs review" with no reviewers in the ongoing
CF, so I decided to take a look at it. I see that Zoltan has posted a
review, so I've added him to the list.
But I took a look at the latest patch in any case. Here are some
comments, mostly cosmetic ones.
> diff -dcrpN postgresql.orig/doc/src/sgml/ref/pg_basebackup.sgml postgresql/doc/src/sgml/ref/pg_basebackup.sgml
> *** postgresql.orig/doc/src/sgml/ref/pg_basebackup.sgml 2013-01-05 17:34:30.742135371 +0100
> --- postgresql/doc/src/sgml/ref/pg_basebackup.sgml 2013-01-07 15:11:40.787007890 +0100
> *************** PostgreSQL documentation
> *** 400,405 ****
> --- 400,425 ----
> </varlistentry>
>
> <varlistentry>
> + <term><option>-r <replaceable class="parameter">interval</replaceable></option></term>
> + <term><option>--recvtimeout=<replaceable class="parameter">interval</replaceable></option></term>
> + <listitem>
> + <para>
> + time that receiver waits for communication from server (in seconds).
> + </para>
> + </listitem>
> + </varlistentry>
I would reword this as "The maximum time (in seconds) to wait for data
from the server (default: wait forever)".
> + <varlistentry>
> + <term><option>-t <replaceable class="parameter">interval</replaceable></option></term>
> + <term><option>--conntimeout=<replaceable class="parameter">interval</replaceable></option></term>
> + <listitem>
> + <para>
> + time that client wait for connection to establish with server (in seconds).
> + </para>
> + </listitem>
> + </varlistentry>
Likewise, "The maximum time (in seconds) to wait for a connection to the
server to succeed (default: wait forever)".
Same thing in pg_receivexlog.sgml. Also, there's trailing whitespace in
various places in these files (and elsewhere in the patch), which should
be fixed.
> diff -dcrpN postgresql.orig/src/bin/pg_basebackup/pg_basebackup.c postgresql/src/bin/pg_basebackup/pg_basebackup.c
> *** postgresql.orig/src/bin/pg_basebackup/pg_basebackup.c 2013-01-05 17:34:30.778135625 +0100
> --- postgresql/src/bin/pg_basebackup/pg_basebackup.c 2013-01-07 15:16:24.610037886 +0100
> *************** bool streamwal = false;
> *** 45,50 ****
> --- 45,54 ----
> bool fastcheckpoint = false;
> bool writerecoveryconf = false;
> int standby_message_timeout = 10 * 1000; /* 10 sec = default */
> + int standby_recv_timeout = 60*1000; /* 60 sec = default */
> + char *standby_connect_timeout = NULL;
I don't really like standby_recv_timeout being an int and
standby_connect_timeout being a char *. I understand that it's so that
it can be assigned to "values[i]" in GetConnection(), but that reason is
very distant, and not obvious from this code at all.
That said, I don't know if it's really worth bothering with.
> + #define NAPTIME_PER_CYCLE 100 /* max sleep time between cycles (100ms) */
This probably needs a better comment. Why are we sleeping between
cycles? What cycles?
> + printf(_(" -r, --recvtimeout=INTERVAL time that receiver waits for communication from\n"
> + " server (in seconds)\n"));
> + printf(_(" -t, --conntimeout=INTERVAL time that client wait for connection to establish\n"
> + " with server (in seconds)\n"));
Same comments about wording apply, but perhaps there's no need to
mention the default.
> ! if (r == 0 || (r < 0 && errno == EINTR))
> ! {
> ! /*
> ! * Got a timeout or signal. Before Continuing the loop, check for timeout.
> ! */
> ! if (standby_recv_timeout > 0)
> ! {
> ! now = localGetCurrentTimestamp();
I'd make "now" local to this block, and get rid of the comment. The two
"if"s are perfectly clear. This applies to the same pattern in other
places in the patch as well.
> ! if (localTimestampDifferenceExceeds(last_recv_timestamp, now, standby_recv_timeout))
> ! {
> ! fprintf(stderr, _("%s: terminating DB File receive due to timeout\n"),
Better wording? "DB File receive" is confusing. Even something like
"Closing connection due to read timeout" would be better. Or perhaps
you can make it like the following message, slightly lower:
> ! if (PQconsumeInput(conn) == 0)
> ! {
> ! fprintf(stderr,
> ! _("%s: could not receive data from WAL Sender: %s"),
> ! progname, PQerrorMessage(conn));
…and in the former case, say "read timeout" instead of PQerrorMessage().
> ! /* Set the last reply timestamp */
> ! last_recv_timestamp = localGetCurrentTimestamp();
> !
> ! /* Some data is received, so go back read them in buffer*/
> ! continue;
No need for these comments.
> + /* Set the last reply timestamp */
> + last_recv_timestamp = localGetCurrentTimestamp();
Likewise (in various places).
> /*
> ! * Connect in replication mode to the server, Sending connect_timeout
> ! * as configured, there is no need for rw_timeout.
> */
> ! conn = GetConnection(standby_connect_timeout);
This comment is pretty confusing.
> * Connect to the server. Returns a valid PGconn pointer if connected,
> * or NULL on non-permanent error. On permanent error, the function will
> * call exit(1) directly.
> + * Set conn_timeout to PGconn structure if their value
> + * is not NULL.
> */
> PGconn *
> ! GetConnection(char *conn_timeout)
And this comment is just wrong.
The patch looks OK otherwise. Zoltan indicated that his tests were
successful, so I didn't retest. Marking "Waiting on author" again.
-- Abhijit
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Review of "pg_basebackup and pg_receivexlog to use non-blocking socket communication", was: Re: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
@ 2013-01-16 10:31 Heikki Linnakangas <hlinnakangas@vmware.com>
parent: Boszormenyi Zoltan <zb@cybertec.at>
2 siblings, 2 replies; 11+ messages in thread
From: Heikki Linnakangas @ 2013-01-16 10:31 UTC (permalink / raw)
To: Boszormenyi Zoltan <zb@cybertec.at>; +Cc: Hari Babu <haribabu.kommi@huawei.com>; Fujii Masao <masao.fujii@gmail.com>; pgsql-hackers@postgresql.org; Amit kapila <amit.kapila@huawei.com>
On 07.01.2013 16:23, Boszormenyi Zoltan wrote:
> Since my other patch against pg_basebackup is now committed,
> this patch doesn't apply cleanly, patch rejects 2 hunks.
> The fixed up patch is attached.
Now that I look at this a high-level perspective, why are we only
worried about timeouts in the Copy-mode and when connecting? The initial
checkpoint could take a long time too, and if the server turns into a
black hole while the checkpoint is running, pg_basebackup will still
hang. Then again, a short timeout on that phase would be a bad idea,
because the checkpoint can indeed take a long time.
In streaming replication, the keep-alive messages carry additional
information, the timestamps and WAL locations, so a keepalive makes
sense at that level. But otherwise, aren't we just trying to reimplement
TCP keepalives? TCP keepalives are not perfect, but if we want to have
an application level timeout, it should be implemented in the FE/BE
protocol.
I don't think we need to do anything specific to pg_basebackup. The user
can simply specify TCP keepalive settings in the connection string, like
with any libpq program.
- Heikki
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Review of "pg_basebackup and pg_receivexlog to use non-blocking socket communication", was: Re: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
@ 2013-01-18 06:50 Amit Kapila <amit.kapila@huawei.com>
parent: Boszormenyi Zoltan <zb@cybertec.at>
2 siblings, 0 replies; 11+ messages in thread
From: Amit Kapila @ 2013-01-18 06:50 UTC (permalink / raw)
To: 'Heikki Linnakangas' <hlinnakangas@vmware.com>; 'Boszormenyi Zoltan' <zb@cybertec.at>; +Cc: 'Hari Babu' <haribabu.kommi@huawei.com>; 'Fujii Masao' <masao.fujii@gmail.com>; pgsql-hackers@postgresql.org
On Wednesday, January 16, 2013 4:02 PM Heikki Linnakangas wrote:
> On 07.01.2013 16:23, Boszormenyi Zoltan wrote:
> > Since my other patch against pg_basebackup is now committed,
> > this patch doesn't apply cleanly, patch rejects 2 hunks.
> > The fixed up patch is attached.
>
> Now that I look at this a high-level perspective, why are we only
> worried about timeouts in the Copy-mode and when connecting? The
> initial
> checkpoint could take a long time too, and if the server turns into a
> black hole while the checkpoint is running, pg_basebackup will still
> hang. Then again, a short timeout on that phase would be a bad idea,
> because the checkpoint can indeed take a long time.
True, but IMO, if somebody want to take basebackup, he should do that when
the server is not loaded.
> In streaming replication, the keep-alive messages carry additional
> information, the timestamps and WAL locations, so a keepalive makes
> sense at that level. But otherwise, aren't we just trying to
> reimplement
> TCP keepalives? TCP keepalives are not perfect, but if we want to have
> an application level timeout, it should be implemented in the FE/BE
> protocol.
>
> I don't think we need to do anything specific to pg_basebackup. The
> user
> can simply specify TCP keepalive settings in the connection string,
> like
> with any libpq program.
I think currently user has no way to specify TCP keepalive settings from
pg_basebackup, please let me know if there is any such existing way?
I think specifying TCP settings is very cumbersome for most users, that's
the reason most standard interfaces (ODBC/JDBC) have such application level
timeout mechanism.
By implementing in FE/BE protocol (do you mean to say that make such
non-blocking behavior inside Libpq or something else), it might be generic
and can be used for others as well but it might need few interface changes.
IMHO if by having such less impact changes for pg_basebackup, it makes
pg_basebackup network sensitive, the current approach can also be
considered.
With Regards,
Amit Kapila.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Review of "pg_basebackup and pg_receivexlog to use non-blocking socket communication", was: Re: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
@ 2013-01-21 12:51 Magnus Hagander <magnus@hagander.net>
parent: Heikki Linnakangas <hlinnakangas@vmware.com>
1 sibling, 1 reply; 11+ messages in thread
From: Magnus Hagander @ 2013-01-21 12:51 UTC (permalink / raw)
To: Amit Kapila <amit.kapila@huawei.com>; +Cc: Heikki Linnakangas <hlinnakangas@vmware.com>; Boszormenyi Zoltan <zb@cybertec.at>; Hari Babu <haribabu.kommi@huawei.com>; Fujii Masao <masao.fujii@gmail.com>; PostgreSQL-development <pgsql-hackers@postgresql.org>
On Fri, Jan 18, 2013 at 7:50 AM, Amit Kapila <amit.kapila@huawei.com> wrote:
> On Wednesday, January 16, 2013 4:02 PM Heikki Linnakangas wrote:
>> On 07.01.2013 16:23, Boszormenyi Zoltan wrote:
>> > Since my other patch against pg_basebackup is now committed,
>> > this patch doesn't apply cleanly, patch rejects 2 hunks.
>> > The fixed up patch is attached.
>>
>> Now that I look at this a high-level perspective, why are we only
>> worried about timeouts in the Copy-mode and when connecting? The
>> initial
>> checkpoint could take a long time too, and if the server turns into a
>> black hole while the checkpoint is running, pg_basebackup will still
>> hang. Then again, a short timeout on that phase would be a bad idea,
>> because the checkpoint can indeed take a long time.
>
> True, but IMO, if somebody want to take basebackup, he should do that when
> the server is not loaded.
A lot of installations don't have such an optino, because there is no
time whe nthe server is not loaded.
>> In streaming replication, the keep-alive messages carry additional
>> information, the timestamps and WAL locations, so a keepalive makes
>> sense at that level. But otherwise, aren't we just trying to
>> reimplement
>> TCP keepalives? TCP keepalives are not perfect, but if we want to have
>> an application level timeout, it should be implemented in the FE/BE
>> protocol.
>>
>> I don't think we need to do anything specific to pg_basebackup. The
>> user
>> can simply specify TCP keepalive settings in the connection string,
>> like
>> with any libpq program.
>
> I think currently user has no way to specify TCP keepalive settings from
> pg_basebackup, please let me know if there is any such existing way?
You can set it through environment variables. As was discussed
elsewhere, it would be good to have the ability to do it natively to
pg_basebackup as well.
> I think specifying TCP settings is very cumbersome for most users, that's
> the reason most standard interfaces (ODBC/JDBC) have such application level
> timeout mechanism.
>
> By implementing in FE/BE protocol (do you mean to say that make such
> non-blocking behavior inside Libpq or something else), it might be generic
> and can be used for others as well but it might need few interface changes.
If it's specifying them that is cumbersome, then that's the part we
should fix, rather than modifying the protocol, no?
--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Review of "pg_basebackup and pg_receivexlog to use non-blocking socket communication", was: Re: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
@ 2013-01-22 06:31 Amit Kapila <amit.kapila@huawei.com>
parent: Heikki Linnakangas <hlinnakangas@vmware.com>
1 sibling, 0 replies; 11+ messages in thread
From: Amit Kapila @ 2013-01-22 06:31 UTC (permalink / raw)
To: 'Magnus Hagander' <magnus@hagander.net>; +Cc: 'Heikki Linnakangas' <hlinnakangas@vmware.com>; 'Boszormenyi Zoltan' <zb@cybertec.at>; 'Hari Babu' <haribabu.kommi@huawei.com>; 'Fujii Masao' <masao.fujii@gmail.com>; 'PostgreSQL-development' <pgsql-hackers@postgresql.org>
On Monday, January 21, 2013 6:22 PM Magnus Hagander
> On Fri, Jan 18, 2013 at 7:50 AM, Amit Kapila <amit.kapila@huawei.com>
> wrote:
> > On Wednesday, January 16, 2013 4:02 PM Heikki Linnakangas wrote:
> >> On 07.01.2013 16:23, Boszormenyi Zoltan wrote:
> >> > Since my other patch against pg_basebackup is now committed,
> >> > this patch doesn't apply cleanly, patch rejects 2 hunks.
> >> > The fixed up patch is attached.
> >>
> >> Now that I look at this a high-level perspective, why are we only
> >> worried about timeouts in the Copy-mode and when connecting? The
> >> initial
> >> checkpoint could take a long time too, and if the server turns into
> a
> >> black hole while the checkpoint is running, pg_basebackup will still
> >> hang. Then again, a short timeout on that phase would be a bad idea,
> >> because the checkpoint can indeed take a long time.
> >
> > True, but IMO, if somebody want to take basebackup, he should do that
> when
> > the server is not loaded.
>
> A lot of installations don't have such an optino, because there is no
> time whe nthe server is not loaded.
Good to know about it.
I have always heard that customer will run background maintenance activities
(Reindex, Vacuum Full, etc) when the server is less loaded.
For example
a. Billing applications in telecom, at night times they can be relatively
less loaded.
b. Any databases used for Sensex transactions, they will be relatively free
once the market is closed.
c. Banking solutions, because transactions are done mostly in day times.
There will be many cases where Database server will be loaded all the times,
if you can give some example, it will be a good learning for me.
> >> In streaming replication, the keep-alive messages carry additional
> >> information, the timestamps and WAL locations, so a keepalive makes
> >> sense at that level. But otherwise, aren't we just trying to
> >> reimplement
> >> TCP keepalives? TCP keepalives are not perfect, but if we want to
> have
> >> an application level timeout, it should be implemented in the FE/BE
> >> protocol.
> >>
> >> I don't think we need to do anything specific to pg_basebackup. The
> >> user
> >> can simply specify TCP keepalive settings in the connection string,
> >> like
> >> with any libpq program.
> >
> > I think currently user has no way to specify TCP keepalive settings
> from
> > pg_basebackup, please let me know if there is any such existing way?
>
> You can set it through environment variables. As was discussed
> elsewhere, it would be good to have the ability to do it natively to
> pg_basebackup as well.
Sure, already modifying the existing patch to support connection string in
pg_basebackup and pg_receivexlog.
>
> > I think specifying TCP settings is very cumbersome for most users,
> that's
> > the reason most standard interfaces (ODBC/JDBC) have such application
> level
> > timeout mechanism.
> >
> > By implementing in FE/BE protocol (do you mean to say that make such
> > non-blocking behavior inside Libpq or something else), it might be
> generic
> > and can be used for others as well but it might need few interface
> changes.
>
> If it's specifying them that is cumbersome, then that's the part we
> should fix, rather than modifying the protocol, no?
That can be done as part of point 2 of initial proposal
(2. Support recv_timeout separately to provide a way to users who are not
comfortable tcp keepalives).
To achieve this there can be 2 ways.
1. Change in FE/BE protocol - I am not sure exactly how this can be done,
but as per Heikki this is better way of implementing it.
2. Make the socket as non-blocking in pg_basebackup.
Advantage of Approach-1 is that if we do in such a fashion that in lower
layers (libpq) it is addressed then all other apps (pg_basebackup, etc) can
use it, no need to handle separately in each application.
So now as changes in Approach-1 seems to be invasive, we decided to do it
later.
With Regards,
Amit Kapila.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 11+ messages in thread
* Re: Review of "pg_basebackup and pg_receivexlog to use non-blocking socket communication", was: Re: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
@ 2013-01-28 09:45 Magnus Hagander <magnus@hagander.net>
parent: Magnus Hagander <magnus@hagander.net>
0 siblings, 0 replies; 11+ messages in thread
From: Magnus Hagander @ 2013-01-28 09:45 UTC (permalink / raw)
To: Amit Kapila <amit.kapila@huawei.com>; +Cc: Heikki Linnakangas <hlinnakangas@vmware.com>; Boszormenyi Zoltan <zb@cybertec.at>; Hari Babu <haribabu.kommi@huawei.com>; Fujii Masao <masao.fujii@gmail.com>; PostgreSQL-development <pgsql-hackers@postgresql.org>
On Tue, Jan 22, 2013 at 7:31 AM, Amit Kapila <amit.kapila@huawei.com> wrote:
> On Monday, January 21, 2013 6:22 PM Magnus Hagander
>> On Fri, Jan 18, 2013 at 7:50 AM, Amit Kapila <amit.kapila@huawei.com>
>> wrote:
>> > On Wednesday, January 16, 2013 4:02 PM Heikki Linnakangas wrote:
>> >> On 07.01.2013 16:23, Boszormenyi Zoltan wrote:
>> >> > Since my other patch against pg_basebackup is now committed,
>> >> > this patch doesn't apply cleanly, patch rejects 2 hunks.
>> >> > The fixed up patch is attached.
>> >>
>> >> Now that I look at this a high-level perspective, why are we only
>> >> worried about timeouts in the Copy-mode and when connecting? The
>> >> initial
>> >> checkpoint could take a long time too, and if the server turns into
>> a
>> >> black hole while the checkpoint is running, pg_basebackup will still
>> >> hang. Then again, a short timeout on that phase would be a bad idea,
>> >> because the checkpoint can indeed take a long time.
>> >
>> > True, but IMO, if somebody want to take basebackup, he should do that
>> when
>> > the server is not loaded.
>>
>> A lot of installations don't have such an optino, because there is no
>> time whe nthe server is not loaded.
>
> Good to know about it.
> I have always heard that customer will run background maintenance activities
> (Reindex, Vacuum Full, etc) when the server is less loaded.
> For example
> a. Billing applications in telecom, at night times they can be relatively
> less loaded.
That assumes there is a nighttime.. If you're operating in enough
timezones, that won't happen.
> b. Any databases used for Sensex transactions, they will be relatively free
> once the market is closed.
> c. Banking solutions, because transactions are done mostly in day times.
True. But those are definitely very very narrow usecases ;)
Don't get me wrong. There are a *lot* of people who have nighttimes to
do maintenance in. They are the lucky ones :) But we can't assume this
scenario.
> There will be many cases where Database server will be loaded all the times,
> if you can give some example, it will be a good learning for me.
Most internet based businesses that do business in multiple countries.
Or really, any business that has customers in multiple timezones
across the world. And even more to the point, any business who's
*customers* have customers in multiple timezones across the world,
provided they are services-based.
>> >> In streaming replication, the keep-alive messages carry additional
>> >> information, the timestamps and WAL locations, so a keepalive makes
>> >> sense at that level. But otherwise, aren't we just trying to
>> >> reimplement
>> >> TCP keepalives? TCP keepalives are not perfect, but if we want to
>> have
>> >> an application level timeout, it should be implemented in the FE/BE
>> >> protocol.
>> >>
>> >> I don't think we need to do anything specific to pg_basebackup. The
>> >> user
>> >> can simply specify TCP keepalive settings in the connection string,
>> >> like
>> >> with any libpq program.
>> >
>> > I think currently user has no way to specify TCP keepalive settings
>> from
>> > pg_basebackup, please let me know if there is any such existing way?
>>
>> You can set it through environment variables. As was discussed
>> elsewhere, it would be good to have the ability to do it natively to
>> pg_basebackup as well.
>
> Sure, already modifying the existing patch to support connection string in
> pg_basebackup and pg_receivexlog.
Good.
>> > I think specifying TCP settings is very cumbersome for most users,
>> that's
>> > the reason most standard interfaces (ODBC/JDBC) have such application
>> level
>> > timeout mechanism.
>> >
>> > By implementing in FE/BE protocol (do you mean to say that make such
>> > non-blocking behavior inside Libpq or something else), it might be
>> generic
>> > and can be used for others as well but it might need few interface
>> changes.
>>
>> If it's specifying them that is cumbersome, then that's the part we
>> should fix, rather than modifying the protocol, no?
>
> That can be done as part of point 2 of initial proposal
> (2. Support recv_timeout separately to provide a way to users who are not
> comfortable tcp keepalives).
Looking at the bigger picture, we should in that case support those on
*all* our frontend applications, and not just pg_basebackup. To me, it
makes more sense to just say "use the connection string method to
connect when you need to set these parameters". There are always going
to be some parameters that require that.
> To achieve this there can be 2 ways.
> 1. Change in FE/BE protocol - I am not sure exactly how this can be done,
> but as per Heikki this is better way of implementing it.
> 2. Make the socket as non-blocking in pg_basebackup.
>
> Advantage of Approach-1 is that if we do in such a fashion that in lower
> layers (libpq) it is addressed then all other apps (pg_basebackup, etc) can
> use it, no need to handle separately in each application.
>
> So now as changes in Approach-1 seems to be invasive, we decided to do it
> later.
Ok - I haven't really been following the thread, but that doesn't seem
unreasonable. The thing I was objecting to is putting in special
parameters to pg_basebackup to deal with it, rather than just
implementing the connection string option, which is consistent with
other tools and will give us other parameters as well for free.
--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 11+ messages in thread
end of thread, other threads:[~2013-01-28 09:45 UTC | newest]
Thread overview: 11+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-01-01 16:48 Review of "pg_basebackup and pg_receivexlog to use non-blocking socket communication", was: Re: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown Boszormenyi Zoltan <zb@cybertec.at>
2013-01-02 07:11 ` Hari Babu <haribabu.kommi@huawei.com>
2013-01-04 12:43 ` Hari Babu <haribabu.kommi@huawei.com>
2013-01-07 14:23 ` Boszormenyi Zoltan <zb@cybertec.at>
2013-01-16 07:48 ` Abhijit Menon-Sen <ams@2ndQuadrant.com>
2013-01-16 10:31 ` Heikki Linnakangas <hlinnakangas@vmware.com>
2013-01-21 12:51 ` Magnus Hagander <magnus@hagander.net>
2013-01-28 09:45 ` Magnus Hagander <magnus@hagander.net>
2013-01-22 06:31 ` Amit Kapila <amit.kapila@huawei.com>
2013-01-18 06:50 ` Amit Kapila <amit.kapila@huawei.com>
2013-01-09 04:02 ` Hari Babu <haribabu.kommi@huawei.com>
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