1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-09 00:45:49 +02:00

Remove raw option for gz compression.

This was a minor optimization used in protocol layer compression.  Even though it was slightly faster, it omitted the crc-32 that is generated during normal compression which could lead to corrupt data after a bad network transmission.  This would be caught on restore by our checksum but it seems better to catch an issue like this early.

The raw option also made the function signature different than future compression formats which may not support raw, or require different code to support raw.

In general, it doesn't seem worth the extra testing to support a format that has minimal benefit and is seldom used, since protocol compression is only enabled when the transmitted data is uncompressed.
This commit is contained in:
David Steele
2020-02-27 12:19:40 -05:00
parent ee351682da
commit 3f77a83e73
22 changed files with 51 additions and 107 deletions

View File

@ -77,7 +77,7 @@ testBackupValidateCallback(void *callbackData, const StorageInfo *info)
StorageRead *read = storageNewReadP(
data->storage,
data->path != NULL ? strNewFmt("%s/%s", strPtr(data->path), strPtr(info->name)) : info->name);
ioFilterGroupAdd(ioReadFilterGroup(storageReadIo(read)), gzDecompressNew(false));
ioFilterGroupAdd(ioReadFilterGroup(storageReadIo(read)), gzDecompressNew());
size = bufUsed(storageGetP(read));
manifestName = strSubN(info->name, 0, strSize(info->name) - strlen("." GZ_EXT));
@ -244,7 +244,7 @@ testBackupPqScript(unsigned int pgVersion, time_t backupTimeStart, TestBackupPqS
strPtr(walChecksum), param.walCompress ? "." GZ_EXT : ""));
if (param.walCompress)
ioFilterGroupAdd(ioWriteFilterGroup(storageWriteIo(write)), gzCompressNew(1, false));
ioFilterGroupAdd(ioWriteFilterGroup(storageWriteIo(write)), gzCompressNew(1));
storagePutP(write, walBuffer);
}