Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wio2T-0007xA-6P for pgsql-bugs@arkaria.postgresql.org; Fri, 09 May 2014 16:52:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wio2S-0001nO-F1 for pgsql-bugs@arkaria.postgresql.org; Fri, 09 May 2014 16:52:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wiip3-00031X-5a for pgsql-bugs@postgresql.org; Fri, 09 May 2014 11:18:37 +0000 Received: from sptxb.gemini.oneoffice.jp ([211.7.82.98]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wiior-00056f-K8 for pgsql-bugs@postgresql.org; Fri, 09 May 2014 11:18:35 +0000 Received: from o3tx-enso01.taurus.oneoffice.jp (unknown [172.16.240.26]) by sptxb.gemini.oneoffice.jp (Postfix) with ESMTP id 59507CE9087 for ; Fri, 9 May 2014 20:18:09 +0900 (JST) Received: from o3tx-repu01.taurus.oneoffice.jp (HELO o3tx-repu.taurus.oneoffice.jp) ([172.16.240.134]) by o3tx-enso01.taurus.oneoffice.jp with ESMTP; 09 May 2014 20:18:17 +0900 Received: from o3tx-repu.taurus.oneoffice.jp (o3tx-repu01.taurus.oneoffice.jp [127.0.0.1]) by o3tx-repu.taurus.oneoffice.jp (Postfix) with ESMTP id 2EF3C558043 for ; Fri, 9 May 2014 20:18:12 +0900 (JST) Received: from o3tx-avsh01.taurus.oneoffice.jp (unknown [172.16.240.10]) by o3tx-repu.taurus.oneoffice.jp (Postfix) with ESMTP id 173C9558026 for ; Fri, 9 May 2014 20:18:12 +0900 (JST) X-IronPort-AV: E=Sophos;i="4.97,1017,1389711600"; d="scan'208";a="491103399" Received: from o3ma-smtp01.taurus.oneoffice.jp ([172.16.242.10]) by o3tx-avsh01.taurus.oneoffice.jp with SMTP; 09 May 2014 20:18:16 +0900 Received: from 172.16.242.10 by o3ma-smtp01.taurus.oneoffice.jp with Mail2000 ESMTP Server V4.50S(20690:0:AUTH_LOGIN) (envelope-from ); Fri, 09 May 2014 20:18:07 +0900 (JST) Message-ID: <536CB975.9050104@beingcorp.co.jp> Date: Fri, 09 May 2014 20:18:13 +0900 From: Shin-ichi MORITA User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Tom Lane CC: Andrus , pgsql-bugs@postgresql.org Subject: Re: BUG #7914: pg_dump aborts occasionally References: <17113.1362429434@sss.pgh.pa.us> <2528D0D4784443EB95A0752179B0C0CE@25a038note> <13236.1362511346@sss.pgh.pa.us> <19324.1362594815@sss.pgh.pa.us> <8804.1399507096@sss.pgh.pa.us> In-Reply-To: <8804.1399507096@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Hi Tom, Thank you for the information. And I'm sorry for not replying sooner. It took time to recall this issue. (2014/05/08 8:58), Tom Lane wrote: > I started thinking about this issue again after seeing a similar report at > http://www.postgresql.org/message-id/flat/850BF81CE7324F81AF2A44C8660CF2EE@dell2 > and this time I think I see the problem. Look at the loop in pqReadData() > created by this test: > > I've been able to reproduce buffer bloat by inserting some delay into > this loop (I put "usleep(10000);" in front of the goto above) and then > sending a steady stream of circa-50KB data messages. Oh, I'm glad to hear that. Thank you for the explanation. > exactly the opposite of what generally happens on Unix machines. Perhaps > Windows schedules differently? Or maybe the reason we're seeing this now, It might be so. Although I'm not sure why it occurred, I think our conditions were rare: Hypervisor: VMware vSphere Hypervisor 5.1 Allocated vCPUs: 1 OS: Windows Server 2012 or 2008R2 (64bit) Run pg_dump under high load or run pb_dump with the Low priority using Windows Task Manager > Anyway, I still don't like your original suggestion of simply skipping > the pqCheckInBufferSpace call; that's just losing the knowledge we have of > how big the next message will be. Rather I think what we are missing here > is that we should deduct the excess space to the left of inStart, and/or > forcibly left-justify the buffer, before deciding that we need to enlarge > the buffer. I think it'd be safe for pqCheckInBufferSpace to do that > (ie move the data within the buffer), though I need to look at the callers > more closely to be sure. I agree with you. The new pqCheckInBufferSpace seems to update inStart, inEnd, and inCursor. I think it would be OK unless the callers assume they won't be updated. Thank you. Shin-ichi -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs