Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)

Поиск
Список
Период
Сортировка
От Aleksander Alekseev
Тема Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)
Дата
Msg-id CAJ7c6TPivODEmn9+kQV=22_W6aowQUwjxTr+jjknFGGonbc5GQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)  (Aleksander Alekseev <aleksander@timescale.com>)
Список pgsql-hackers
Maxim,

I see both of us accounted for Alexanders feedback and submitted v59.
Your newer version seems to have issues on cfbot, so resubmitting the
previous patchset that passes the tests. Please feel free to add
changes.

> See SlruCorrectSegmentFilenameLength():
>
> ```
>     if (ctl->long_segment_names)
>         return (len == 15); /* see SlruFileName() */
>     else
>         /*
>          * Commit 638cf09e76d allowed 5-character lengths. Later commit
>          * 73c986adde5 allowed 6-character length.
>          *
>          * XXX should we still consider such names to be valid?
>          */
>         return (len == 4 || len == 5 || len == 6);
> ```
>
> Should we just drop it or check that segno is <= 0xFFFFFF?

I also choose to change this Assert and to add a corresponding comment:

        else
        {
-               Assert(segno >= 0 && segno <= 0xFFFF);
+               /*
+                * Despite the fact that %04X format string is used up to 24 bit
+                * integers are allowed. See SlruCorrectSegmentFilenameLength()
+                */
+               Assert(segno >= 0 && segno <= 0xFFFFFF);
                return snprintf(path, MAXPGPATH, "%s/%04X", (ctl)->Dir,
                                                (unsigned int) segno);
        }


--
Best regards,
Aleksander Alekseev

Вложения

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

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: [PATCHES] Post-special page storage TDE support
Следующее
От: "Drouvot, Bertrand"
Дата:
Сообщение: Re: Synchronizing slots from primary to standby