From 5f840ba436df95f3154398acee2303e5f8a58265 Mon Sep 17 00:00:00 2001 From: Konstantin Knizhnik Date: Fri, 28 Jun 2019 10:09:03 +0300 Subject: [PATCH 1/2] Fix passing error in fio_send_pages --- src/utils/file.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/file.c b/src/utils/file.c index 568f66b5..71a62713 100644 --- a/src/utils/file.c +++ b/src/utils/file.c @@ -1150,8 +1150,7 @@ int fio_send_pages(FILE* in, FILE* out, pgFile *file, if ((int)hdr.arg < 0) /* read error */ { - errno = -(int)hdr.arg; - return -1; + return (int)hdr.arg; } blknum = hdr.arg; From 79f940ff759a184e485b5095b01170d739507057 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Fri, 28 Jun 2019 12:47:13 +0300 Subject: [PATCH 2/2] checkdb: don`t close descriptor if file size is not aligned BLCKSZ --- src/data.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/data.c b/src/data.c index 3536895d..0304f10b 100644 --- a/src/data.c +++ b/src/data.c @@ -585,7 +585,7 @@ backup_data_file(backup_files_arg* arguments, } if (file->size % BLCKSZ != 0) - elog(WARNING, "File: %s, invalid file size %zu", file->path, file->size); + elog(WARNING, "File: \"%s\", invalid file size %zu", file->path, file->size); /* * Compute expected number of blocks in the file. @@ -622,7 +622,7 @@ backup_data_file(backup_files_arg* arguments, if (rc == PAGE_CHECKSUM_MISMATCH && is_ptrack_support) goto RetryUsingPtrack; if (rc < 0) - elog(ERROR, "Failed to read file %s: %s", + elog(ERROR, "Failed to read file \"%s\": %s", file->path, rc == PAGE_CHECKSUM_MISMATCH ? "data file checksum mismatch" : strerror(-rc)); n_blocks_read = rc; } @@ -1209,10 +1209,7 @@ check_data_file(ConnectionArgs *arguments, } if (file->size % BLCKSZ != 0) - { - fclose(in); - elog(WARNING, "File: %s, invalid file size %zu", file->path, file->size); - } + elog(WARNING, "File: \"%s\", invalid file size %zu", file->path, file->size); /* * Compute expected number of blocks in the file.