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

From Michael Paquier
Subject Re: BUG #13888: pg_dump write error
Date
Msg-id CAB7nPqRsARVk_5T3pks3KEc+yusSdOirFNFzUiYPiG4KJDJPEA@mail.gmail.com
Whole thread Raw
In response to Re: BUG #13888: pg_dump write error  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: BUG #13888: pg_dump write error
List pgsql-bugs
On Tue, Jan 26, 2016 at 1:08 AM, 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?

Indeed, with a closer look there are things like tarWrite that can
return 0 and trigger WRITE_ERROR_EXIT with the same thing. Couldn't we
simply check for errno = 0 and generate a more generic error message
instead? Or are you willing at replacing all those things with just
exit_horribly()?
--
Michael

pgsql-bugs by date:

Previous
From: Dmitriy Sarafannikov
Date:
Subject: Re: [BUGS] Postgres backend segfault
Next
From: Tom Lane
Date:
Subject: Re: BUG #13888: pg_dump write error