mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2026-06-21 01:34:15 +02:00
[Issue #228] fix decompression errors
This commit is contained in:
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user