Re: O(n^2) system calls in RemoveOldXlogFiles()

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: O(n^2) system calls in RemoveOldXlogFiles()
Дата
Msg-id 20210112151024.GA364@alvherre.pgsql
обсуждение исходный текст
Ответ на O(n^2) system calls in RemoveOldXlogFiles()  (Thomas Munro <thomas.munro@gmail.com>)
Ответы Re: O(n^2) system calls in RemoveOldXlogFiles()  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
On 2021-Jan-11, Thomas Munro wrote:

> I didn't check the migration history of this code but it seems that
> endlogSegNo doesn't currently have the right scoping to achieve the
> goal of that last comment, so checkpoints finish up repeatedly search
> for the next free slot, starting at the low end each time,

Apparently b2a5545bd63f changed; before that commit, that code
(including the quoted comment) was all in RemoveOldXlogFiles, and
endlogSegNo was calculated only once.  But ISTM that even with that
formulation it had the problem you point out.  The real problem is the
loop hidden inside InstallXLogFileSegment().

-- 
Álvaro Herrera



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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Fix a typo in xlogreader.c
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Executing inet_server_addr/port() in parallel workers