Re: Fix an incorrect assertion condition in mdwritev().

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Fix an incorrect assertion condition in mdwritev().
Дата
Msg-id ZlKArtPhzn868no_@paquier.xyz
обсуждение исходный текст
Ответ на Fix an incorrect assertion condition in mdwritev().  (Xing Guo <higuoxing@gmail.com>)
Ответы Re: Fix an incorrect assertion condition in mdwritev().
Список pgsql-hackers
On Sat, May 25, 2024 at 11:52:22PM +0800, Xing Guo wrote:
> In commit 4908c58[^1], a vectored variant of smgrwrite() is added and
> the assertion condition in mdwritev() no longer matches the comment.
> This patch helps fix it.
>
>      /* This assert is too expensive to have on normally ... */
>  #ifdef CHECK_WRITE_VS_EXTEND
> -    Assert(blocknum < mdnblocks(reln, forknum));
> +    Assert(blocknum + nblocks <= mdnblocks(reln, forknum));
>  #endif

Yes, it looks like you're right that this can be made stricter,
computing the number of blocks we're adding in the number calculated
(aka adding one block to this number fails immediately at initdb).
--
Michael

Вложения

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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: DROP OWNED BY fails to clean out pg_init_privs grants
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: First draft of PG 17 release notes