pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <amit.kapila@huawei.com>
To: 'Fujii Masao' <masao.fujii@gmail.com>
Cc: 'Heikki Linnakangas' <hlinnakangas@vmware.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
Date: Fri, 16 Nov 2012 17:10:03 +0530
Message-ID: <00ad01cdc3ef$1ede2f10$5c9a8d30$@kapila@huawei.com> (raw)
In-Reply-To: <6C0B27F7206C9E4CA54AE035729E9C38285499FA@szxeml509-mbx>
References: <E1TBlX1-0003OA-SB@wrigleys.postgresql.org>
	<CAHGQGwGG=UxNOJX0V966CftRm4C_54XDfaR2TRzWXysFFQcJSw@mail.gmail.com>
	<6C0B27F7206C9E4CA54AE035729E9C382853288B@szxeml509-mbs>
	<CAHGQGwGWMOc-hKTyjjswzYLykAsA2+t+xpcybi6c+DkN+5dA+A@mail.gmail.com>
	<5056cb6b.29f2440a.7bd9.1633SMTPIN_ADDED@mx.google.com>
	<CAHGQGwG2cWJ+Fr+AroXEA3=26Yrc_C4yMW6HJ8rhX9nKm7Z0NA@mail.gmail.com>
	<6C0B27F7206C9E4CA54AE035729E9C38285337FF@szxeml509-mbs>
	<506972B9.6060104@vmware.com>
	<6C0B27F7206C9E4CA54AE035729E9C38285358F7@szxeml509-mbs>
	<506AA530.30106@vmware.com>
	<6C0B27F7206C9E4CA54AE035729E9C382853645A@szxeml509-mbs>
	<507597E2.8090701@vmware.com>
	<5076DD38.8020804@vmware.com>
	<CAHGQGwHyMwP8YqmcDynrsGbOax=dL7HmxAnZ68Azr36_7wJ0WQ@mail.gmail.com>
	<507BE1AD.2060709@vmware.com>
	<507e9adc.43db440a.5351.fffff4d0SMTPIN_ADDED@mx.google.com>
	<CAHGQGwHcYME6VdGwwfOrbA27A5ju+MyL4WwaUDK_tPtZ2_uNoQ@mail.gmail.com>
	<6C0B27F7206C9E4CA54AE035729E9C382853BBED@szxeml509-mbs>
	<509B6E66.9070408@vmware.com>
	<CAHGQGwGdYJ1tJDHH+FURgaJhRR1kmp vKatpBdmgLsk7ZMhYKPA@mail.gmail.com>
	<509c9cd1.494f420a.3fc7.4362SMTPIN_ADDED@mx.google.com>
	<CAHGQGwHxvOUPrtXDBMtDGHc7+7dEsF7G4GmfN2_CTPKeQXqe_Q@mail.gmail.com>
	<6C0B27F7206C9E4CA54AE035729E9C38285499FA@szxeml509-mbx>

On Thursday, November 15, 2012 7:29 PM Amit kapila wrote:
> 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
> 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.

Done the analysis and seems that for below API's also, we need equivalent
noblock, otherwise same problem can happen as they are also
used in the flow.
        a. pq_endmessage 
        b. EndCommand 
        c. pq_puttextmessage 
        d. pq_putemptymessage 
        e. ReadyForQuery - For this, because now walsender and normal
backend are same.
        f. ReadCommand - For this, because now walsender and normal backend
are same. It seems solution for it can be tricky as pq_getbyte is not called
from first level function.

Suggestions/Thoughts?


With Regards,
Amit Kapila.





view thread (55+ messages)

Message-ID: <00ad01cdc3ef$1ede2f10$5c9a8d30$@kapila@huawei.com>
Permalink:  ../00ad01cdc3ef$1ede2f10$5c9a8d30$@kapila@huawei.com/
Also on:    postgresql.org/message-id/00ad01cdc3ef$1ede2f10$5c9a8d30$@kapila@huawei.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: amit.kapila@huawei.com, masao.fujii@gmail.com, hlinnakangas@vmware.com, pgsql-hackers@postgresql.org
  Subject: Re: [BUGS] BUG #7534: walreceiver takes long time to detect n/w breakdown
  In-Reply-To: <00ad01cdc3ef$1ede2f10$5c9a8d30$@kapila@huawei.com>
  References: <E1TBlX1-0003OA-SB@wrigleys.postgresql.org> <CAHGQGwG2cWJ+Fr+AroXEA3=26Yrc_C4yMW6HJ8rhX9nKm7Z0NA@mail.gmail.com> <6C0B27F7206C9E4CA54AE035729E9C38285337FF@szxeml509-mbs> <506972B9.6060104@vmware.com> <6C0B27F7206C9E4CA54AE035729E9C38285358F7@szxeml509-mbs> <506AA530.30106@vmware.com> <6C0B27F7206C9E4CA54AE035729E9C382853645A@szxeml509-mbs> <507597E2.8090701@vmware.com> <5076DD38.8020804@vmware.com> <CAHGQGwHyMwP8YqmcDynrsGbOax=dL7HmxAnZ68Azr36_7wJ0WQ@mail.gmail.com> <507BE1AD.2060709@vmware.com> <507e9adc.43db440a.5351.fffff4d0SMTPIN_ADDED@mx.google.com> <CAHGQGwHcYME6VdGwwfOrbA27A5ju+MyL4WwaUDK_tPtZ2_uNoQ@mail.gmail.com> <6C0B27F7206C9E4CA54AE035729E9C382853BBED@szxeml509-mbs> <509B6E66.9070408@vmware.com> <509c9cd1.494f420a.3fc7.4362SMTPIN_ADDED@mx.google.com> <CAHGQGwHxvOUPrtXDBMtDGHc7+7dEsF7G4GmfN2_CTPKeQXqe_Q@mail.gmail.com> <6C0B27F7206C9E4CA54AE035729E9C38285499FA@szxeml509-mbx> <00ad01cdc3ef$1ede2f10$5c9a8d30$@kapila@huawei.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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