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:
parent
8cbbce0b15
commit
76f9267efe
@ -528,7 +528,7 @@ compress_and_backup_page(pgFile *file, BlockNumber blknum,
|
|||||||
file->write_size += write_buffer_size;
|
file->write_size += write_buffer_size;
|
||||||
file->uncompressed_size += BLCKSZ;
|
file->uncompressed_size += BLCKSZ;
|
||||||
|
|
||||||
return write_buffer_size;
|
return compressed_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
15
src/dir.c
15
src/dir.c
@ -250,6 +250,21 @@ delete_file:
|
|||||||
elog(ERROR, "Cannot remove file \"%s\": %s", full_path,
|
elog(ERROR, "Cannot remove file \"%s\": %s", full_path,
|
||||||
strerror(errno));
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1783,7 +1783,7 @@ static void fio_send_pages_impl(int out, char* buf)
|
|||||||
headers[hdr_num].lsn = page_st.lsn;
|
headers[hdr_num].lsn = page_st.lsn;
|
||||||
headers[hdr_num].checksum = page_st.checksum;
|
headers[hdr_num].checksum = page_st.checksum;
|
||||||
headers[hdr_num].pos = hdr_cur_pos;
|
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;
|
hdr_cur_pos += hdr.size;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user