Re: [PATCH] Fix minor issues in astreamer_zstd.c

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [PATCH] Fix minor issues in astreamer_zstd.c
Дата
Msg-id aWNM7BSFw7GFDTNQ@paquier.xyz
обсуждение исходный текст
Ответ на Re: [PATCH] Fix minor issues in astreamer_zstd.c  ("zengman" <zengman@halodbtech.com>)
Ответы Re: [PATCH] Fix minor issues in astreamer_zstd.c
Re: [PATCH] Fix minor issues in astreamer_zstd.c
Список pgsql-hackers
On Sun, Jan 11, 2026 at 12:24:22PM +0800, zengman wrote:
> Thank you for your review. I've moved it to 0003, and the test
> passed without any issues.
> However, I'm wondering why no one else reported this. Perhaps this
> part isn't actually worth changing.

Could you demonstrate one or more examples when using these APIs
proving that in some cases the current code can be a problem while the
"fixed" code improves the situation, then extract test cases to be
able to cover our future tracks?  This would take the shape of one or
more regression tests to demonstrate individual problems.  If the
three code paths touched here prove to be problematic, we would need
three cases in total.  One other possibility would be to use a set of
asserts to make sure that nobody uses these APIs in ways we don't
expect them to.

Note that for the astream code, the lz4, gzip and zstd code paths rely
on their own assumptions regarding how the input and output buffers
are processed, some of them related to the way the libraries we rely
on behave.  So it goes beyond the point of having a consistent
implementation across all the libraries when the contents are
finalized, for sometimes behaviors that need to work across all the
versions of these libraries supported.

The TAP tests of pg_verifybackup stress the cases where bytes_written
is 0 for lz4 and gzip, there is nothing for the 0-case for zstd,
though.

Saying all that, the comment is indeed wrong.
--
Michael

Вложения

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