Re: Do away with zero-padding assumption before WALRead()

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Re: Do away with zero-padding assumption before WALRead()
Дата
Msg-id CALj2ACVbYa309nvR-sGPX+bWOfn=jT5nw1nF2fna9MJBbtX2OA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Do away with zero-padding assumption before WALRead()  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Ответы Re: Do away with zero-padding assumption before WALRead()  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-hackers
On Mon, Feb 19, 2024 at 8:26 AM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
>
> On
> the flip side, SimpleXLogPageRead always reads a whole page and
> returns XLOG_BLCKSZ. However, as you know, the returned buffer doesn't
> contain random garbage bytes.

Is this assumption true when wal_init_zero is off? I think when
wal_init_zero is off, the last few bytes of the last page from the WAL
file may contain garbage bytes i.e. not zero bytes, no?

> Therefore, it's safe as long as the
> caller doesn't access beyond the returned count. As a result, the
> description you pointed out seems to be enough.

Right.

> After all, the patch looks good to me.

Thanks. It was committed -
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=73f0a1326608ac3a7d390706fdeec59fe4dc42c0.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



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

Предыдущее
От: shveta malik
Дата:
Сообщение: Re: A new message seems missing a punctuation
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: A new message seems missing a punctuation