1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-01-09 14:45:47 +02:00

[Issue #228] fix decompression errors

This commit is contained in:
Grigory Smolkin 2020-06-17 17:56:17 +03:00
parent 8cbbce0b15
commit 76f9267efe
3 changed files with 17 additions and 2 deletions

View File

@ -528,7 +528,7 @@ compress_and_backup_page(pgFile *file, BlockNumber blknum,
file->write_size += write_buffer_size;
file->uncompressed_size += BLCKSZ;
return write_buffer_size;
return compressed_size;
}
/*

View File

@ -250,6 +250,21 @@ delete_file:
elog(ERROR, "Cannot remove file \"%s\": %s", full_path,
strerror(errno));
}
if (file->n_headers > 0)
{
char full_path_hdr[MAXPGPATH];
snprintf(full_path_hdr, MAXPGPATH, "%s_hdr", full_path);
if (remove(full_path_hdr) == -1)
{
if (errno == ENOENT)
return;
elog(ERROR, "Cannot remove file \"%s\": %s", full_path_hdr,
strerror(errno));
}
}
}
/*

View File

@ -1783,7 +1783,7 @@ static void fio_send_pages_impl(int out, char* buf)
headers[hdr_num].lsn = page_st.lsn;
headers[hdr_num].checksum = page_st.checksum;
headers[hdr_num].pos = hdr_cur_pos;
headers[hdr_num].compressed_size = hdr.size;
headers[hdr_num].compressed_size = compressed_size;
hdr_cur_pos += hdr.size;
}