Re: Teach pg_receivewal to use lz4 compression

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Teach pg_receivewal to use lz4 compression
Дата
Msg-id YZcG7J0WEiddgtBp@paquier.xyz
обсуждение исходный текст
Ответ на Re: Teach pg_receivewal to use lz4 compression  (Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>)
Ответы Re: Teach pg_receivewal to use lz4 compression  (gkokolatos@pm.me)
Re: Teach pg_receivewal to use lz4 compression  (Jeevan Ladhe <jeevan.ladhe@enterprisedb.com>)
Список pgsql-hackers
On Thu, Nov 18, 2021 at 07:54:37PM +0530, Jeevan Ladhe wrote:
> In dir_open_for_write() I observe that we are writing the header
> and then calling LZ4F_compressEnd() in case there is an error
> while writing the buffer to the file, and the output buffer of
> LZ4F_compressEnd() is not written anywhere. Why should this be
> necessary? To flush the contents of the internal buffer? But, then we
> are calling LZ4F_freeCompressionContext() immediately after the
> LZ4F_compressEnd() call. I might be missing something, will be
> happy to get more insights.

My concern here was symmetry, where IMO it makes sense to have a
compressEnd call each time there is a successful compressBegin call
done for the LZ4 state data, as there is no way to know if in the
future LZ4 won't change some of its internals to do more than just an
internal flush.
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Greg Nancarrow
Дата:
Сообщение: Re: Skipping logical replication transactions on subscriber side
Следующее
От: "houzj.fnst@fujitsu.com"
Дата:
Сообщение: RE: parallel vacuum comments