1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-11-24 08:52:38 +02:00

fix args for fio_send_pages

This commit is contained in:
Grigory Smolkin 2020-06-29 22:45:06 +03:00
parent fb3417868b
commit c89f87b8db
3 changed files with 14 additions and 15 deletions

View File

@ -618,9 +618,7 @@ backup_data_file(ConnectionArgs* conn_arg, pgFile *file,
/* send prev backup START_LSN */
backup_mode == BACKUP_MODE_DIFF_DELTA &&
file->exists_in_prev ? prev_backup_start_lsn : InvalidXLogRecPtr,
calg, clevel, checksum_version,
/* send pagemap if any */
use_pagemap ? &file->pagemap : NULL,
calg, clevel, checksum_version, use_pagemap,
&headers, backup_mode, ptrack_version_num, ptrack_schema);
}

View File

@ -1124,9 +1124,10 @@ extern int send_pages(ConnectionArgs* conn_arg, const char *to_fullpath, const c
/* FIO */
extern void fio_delete(mode_t mode, const char *fullpath, fio_location location);
extern int fio_send_pages(const char *to_fullpath, const char *from_fullpath, pgFile *file, XLogRecPtr horizonLsn,
int calg, int clevel, uint32 checksum_version, datapagemap_t *pagemap,
BlockNumber* err_blknum, char **errormsg, BackupPageHeader2 **headers);
extern int fio_send_pages(const char *to_fullpath, const char *from_fullpath, pgFile *file,
XLogRecPtr horizonLsn, int calg, int clevel, uint32 checksum_version,
bool use_pagemap, BlockNumber* err_blknum, char **errormsg,
BackupPageHeader2 **headers);
/* return codes for fio_send_pages */
extern int fio_send_file_gz(const char *from_fullpath, const char *to_fullpath, FILE* out, char **errormsg);
extern int fio_send_file(const char *from_fullpath, const char *to_fullpath, FILE* out,

View File

@ -1399,10 +1399,10 @@ static void fio_load_file(int out, char const* path)
* In case of DELTA mode horizonLsn must be a valid lsn,
* otherwise it should be set to InvalidXLogRecPtr.
*/
int fio_send_pages(const char *to_fullpath, const char *from_fullpath, pgFile *file, XLogRecPtr horizonLsn,
int calg, int clevel, uint32 checksum_version,
datapagemap_t *pagemap, BlockNumber* err_blknum,
char **errormsg, BackupPageHeader2 **headers)
int fio_send_pages(const char *to_fullpath, const char *from_fullpath, pgFile *file,
XLogRecPtr horizonLsn, int calg, int clevel, uint32 checksum_version,
bool use_pagemap, BlockNumber* err_blknum, char **errormsg,
BackupPageHeader2 **headers)
{
FILE *out = NULL;
char *out_buf = NULL;
@ -1423,10 +1423,10 @@ int fio_send_pages(const char *to_fullpath, const char *from_fullpath, pgFile *f
req.hdr.cop = FIO_SEND_PAGES;
if (pagemap)
if (use_pagemap)
{
req.hdr.size = sizeof(fio_send_request) + pagemap->bitmapsize + strlen(from_fullpath) + 1;
req.arg.bitmapsize = pagemap->bitmapsize;
req.hdr.size = sizeof(fio_send_request) + (*file).pagemap.bitmapsize + strlen(from_fullpath) + 1;
req.arg.bitmapsize = (*file).pagemap.bitmapsize;
/* TODO: add optimization for the case of pagemap
* containing small number of blocks with big serial numbers:
@ -1465,8 +1465,8 @@ int fio_send_pages(const char *to_fullpath, const char *from_fullpath, pgFile *f
IO_CHECK(fio_write_all(fio_stdout, from_fullpath, req.arg.path_len), req.arg.path_len);
/* send pagemap if any */
if (pagemap)
IO_CHECK(fio_write_all(fio_stdout, pagemap->bitmap, pagemap->bitmapsize), pagemap->bitmapsize);
if (use_pagemap)
IO_CHECK(fio_write_all(fio_stdout, (*file).pagemap.bitmap, (*file).pagemap.bitmapsize), (*file).pagemap.bitmapsize);
while (true)
{