pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shin-ichi MORITA <s-morita@beingcorp.co.jp>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7914: pg_dump aborts occasionally
Date: Wed, 6 Mar 2013 12:59:27 +0900
Message-ID: <D21BF31C50304BEEB86E10C12ED7E1FE@25a038note> (raw)
In-Reply-To: <13236.1362511346@sss.pgh.pa.us>
References: <E1UCTUD-0000L3-C1@wrigleys.postgresql.org>
	<17113.1362429434@sss.pgh.pa.us>
	<2528D0D4784443EB95A0752179B0C0CE@25a038note>
	<13236.1362511346@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

>>> Hm.  Can you create a reproducible test case for this?
>> I think this issue happens when pg_dump is slower than the backend
>> for some reason.
> 
> If so, perhaps injecting a sleep() delay into the right place in pg_dump
> or libpq would make it reproducible?  I wouldn't have any problem
> crediting a test with such modified code as being a valid test.

I think it's a good idea.
Although I can not confirm this by actually modifying the code right now,
somewhere in the loop calling PQgetCopyData() in pg_dump.c would be good.

pg_dump.c:
1348: for (;;)
1349: {
1350:     ret = PQgetCopyData(conn, &copybuf, 0);
1351:
1352:     if (ret < 0)
1353:         break;              /* done or error */
1354:
1355:     if (copybuf)
1356:     {
1357:         WriteData(fout, copybuf, ret);
1358:         PQfreemem(copybuf);
1359:     }
          sleep(1); /* maybe */

An alternative way would be running pg_dump with a lower priority.
Actually, I can reproduce this issue by setting the priority of
pg_dump to Low using Windows Task Manager
on the "single processor" environment.

Regards,
Shin-ichi MORITA




-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (9+ messages)  latest in thread

Message-ID: <D21BF31C50304BEEB86E10C12ED7E1FE@25a038note>
Permalink:  ../D21BF31C50304BEEB86E10C12ED7E1FE@25a038note/
Also on:    postgresql.org/message-id/D21BF31C50304BEEB86E10C12ED7E1FE@25a038note

 · 

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: s-morita@beingcorp.co.jp, tgl@sss.pgh.pa.us
  Subject: Re: BUG #7914: pg_dump aborts occasionally
  In-Reply-To: <D21BF31C50304BEEB86E10C12ED7E1FE@25a038note>
  References: <E1UCTUD-0000L3-C1@wrigleys.postgresql.org> <17113.1362429434@sss.pgh.pa.us> <2528D0D4784443EB95A0752179B0C0CE@25a038note> <13236.1362511346@sss.pgh.pa.us> <D21BF31C50304BEEB86E10C12ED7E1FE@25a038note>

* 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