Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aQiwm-0003n5-LZ for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Feb 2016 21:57:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aQiwm-0005P5-3S for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Feb 2016 21:57:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aQiw9-0004g5-IC for pgsql-bugs@postgresql.org; Tue, 02 Feb 2016 21:56:37 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aQiw7-0002MB-6P for pgsql-bugs@postgresql.org; Tue, 02 Feb 2016 21:56:37 +0000 Received: from [10.56.170.46] (tmo-106-70.customers.d1-online.com [80.187.106.70]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id 6E51B3AAFAB; Tue, 2 Feb 2016 22:56:33 +0100 (CET) User-Agent: K-9 Mail for Android In-Reply-To: <19038.1454447574@sss.pgh.pa.us> References: <20160127113326.GA639380@alvherre.pgsql> <19038.1454447574@sss.pgh.pa.us> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: BUG #13888: pg_dump write error From: Andres Freund Date: Tue, 02 Feb 2016 22:56:33 +0100 To: Tom Lane ,Alvaro Herrera CC: Michael Paquier , kunschikov@gmail.com, PostgreSQL mailing lists Message-ID: <56789B34-35AF-4A95-B922-332C685265AB@anarazel.de> X-Pg-Spam-Score: -4.6 (----) 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 On February 2, 2016 10:12:54 PM GMT+01:00, Tom Lane wrote: >Actually, now that I think about it while not in an airport, what I >think we really need is logic along the lines of > > errno = 0; > nbytes = fwrite(...); > if (nbytes != expected && errno == 0) > errno = ENOSPC; > >ie, assume a short write implies out-of-disk-space. I believe that >is what we do in most (hopefully all) cases in the backend; see for >example UpdateControlFile() in xlog.c. There's an exception: when writing WAL we intentionally retry on short writes. IIRC Heikki added that after we found a case where large writes returned short, but non zero, and trying again to finish the rest works. I'm nor sure of there aren't other cases where that should be done, die to large writes. Andres --- Please excuse brevity and formatting - I am writing this on my mobile phone. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs