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