Re: BUG #13888: pg_dump write error - Mailing list pgsql-bugs

From Vladimir Kunschikov
Subject Re: BUG #13888: pg_dump write error
Date
Msg-id CAFWCTZYuaExdp=7_bqPkRHYSx-m=nQbrW3CeaX2LKWfcSGkvBg@mail.gmail.com
Whole thread Raw
In response to Re: BUG #13888: pg_dump write error  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-bugs
Attached small refactoring of the ahwrite() which includes checking of the errno.
It was made with postgres-9.4.5 sources but applicable to 9.4.1 and even to 9.5.0 with small fuss at ExecuteSqlCommandBuf() call
It could be done  with small check of the errno with rerun without any refactoring.

On Mon, Jan 25, 2016 at 7:08 PM, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
kunschikov@gmail.com wrote:

> Database backup in heavy loaded environment sometimes fails with the
> following error:
>
>  pg_dump: [parallel archiver] could not write to output file: Success
>
> Subsequent rerun of the pg_dump solves that problem.
> More elegant and reliable solution:  WRITE_ERROR_EXIT macro replacement in
> ahwrite() function at src/bin/pg_dump/pg_backup_archiver.c source file.
> There can be some error checking instead of this macro.

Yeah, I noticed this and similar lacks of error checks in pg_dump in
code review, which I didn't get around to patching.  Care to submit a
patch?

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-bugs by date:

Previous
From: Dennis Kögel
Date:
Subject: Parallel pg_restore fails to import views with triggers (dependency problem?)
Next
From: Vladimir Bilyak
Date:
Subject: Re[2]: [BUGS] BUG #13889: psql doesn't exequte correct script