From 7e2fccd0412e81b5949ae02a6360f9e992bbf284 Mon Sep 17 00:00:00 2001 From: Grigory Smolkin Date: Fri, 23 Nov 2018 18:16:49 +0300 Subject: [PATCH] bugfix: use CRC32 for crc comparison during archive-push if target WAL segment is compressed --- src/data.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data.c b/src/data.c index 924e0fb7..9e54b2cc 100644 --- a/src/data.c +++ b/src/data.c @@ -1686,7 +1686,7 @@ fileEqualCRC(const char *path1, const char *path2, bool path2_is_compressed) char buf [1024]; gzFile gz_in = NULL; - INIT_CRC32C(crc2); + INIT_FILE_CRC32(false, crc2); gz_in = gzopen(path2, PG_BINARY_R); if (gz_in == NULL) /* File cannot be read */ @@ -1704,11 +1704,11 @@ fileEqualCRC(const char *path1, const char *path2, bool path2_is_compressed) "Cannot compare WAL file \"%s\" with compressed \"%s\"", path1, path2); - COMP_CRC32C(crc2, buf, read_len); + COMP_FILE_CRC32(false, crc2, buf, read_len); if (gzeof(gz_in) || read_len == 0) break; } - FIN_CRC32C(crc2); + FIN_FILE_CRC32(false, crc2); if (gzclose(gz_in) != 0) elog(ERROR, "Cannot close compressed WAL file \"%s\": %s",