Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aQjVV-0007eM-IG for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Feb 2016 22:33:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aQjVV-0003lb-0u for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Feb 2016 22:33:09 +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 1aQjUs-00034o-TN for pgsql-bugs@postgresql.org; Tue, 02 Feb 2016 22:32:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aQjUq-00038K-5w for pgsql-bugs@postgresql.org; Tue, 02 Feb 2016 22:32:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u12MWM2L021644; Tue, 2 Feb 2016 17:32:22 -0500 From: Tom Lane To: Andres Freund cc: Alvaro Herrera , Michael Paquier , kunschikov@gmail.com, PostgreSQL mailing lists Subject: Re: BUG #13888: pg_dump write error In-reply-to: <56789B34-35AF-4A95-B922-332C685265AB@anarazel.de> References: <20160127113326.GA639380@alvherre.pgsql> <19038.1454447574@sss.pgh.pa.us> <56789B34-35AF-4A95-B922-332C685265AB@anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 02 Feb 2016 22:56:33 +0100" Date: Tue, 02 Feb 2016 17:32:22 -0500 Message-ID: <21643.1454452342@sss.pgh.pa.us> X-Pg-Spam-Score: -2.3 (--) 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 Andres Freund writes: > On February 2, 2016 10:12:54 PM GMT+01:00, Tom Lane wrote: >> 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. I could support making pg_dump do that if there's a way to do it when writing through zlib (which is probably the normal case these days). I'm not at all sure that gzwrite() is retryable after a partial write; that would likely have consequences for the internal state of the compressor. In any case, if you get nbytes == 0 and errno == 0, substituting ENOSPC seems like the right thing. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs