Re: [HACKERS] Slow I/O can break throttling of base backup

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: [HACKERS] Slow I/O can break throttling of base backup
Дата
Msg-id CABUevEw9Gcf65uFgPTy9uC3WuKQsbJN-q9ROgUC3ApAVMerN=A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] Slow I/O can break throttling of base backup  (Antonin Houska <ah@cybertec.at>)
Список pgsql-hackers


On Fri, Dec 16, 2016 at 11:24 AM, Antonin Houska <ah@cybertec.at> wrote:
Antonin Houska <ah@cybertec.at> wrote:

> It seems to be my bug. I'll check tomorrow.

I could reproduce the problem by adding sufficient sleep time to the
loop.

> Magnus Hagander <magnus@hagander.net> wrote:
>> I wonder if the else if (sleep > 0) at the bottom of throttle() should just
>> be a simple else and always run, resetting last_throttle?

I agree. In fact, I could simplify the code even more.

Since (elapsed + sleep) almost equals to GetCurrentIntegerTimestamp(), we can
use the following statement unconditionally (I think I tried too hard to avoid
calling GetCurrentIntegerTimestamp too often in the original patch):

throttled_last = GetCurrentIntegerTimestamp();

Thus we can also get rid of the "else" branch that clears both "sleep" and
"wait_result".

(The patch contains minor comment refinement that I found useful when seeing
the code after years.)


Thanks! Applied and backpatched. 

--

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

Предыдущее
От: Petr Jelinek
Дата:
Сообщение: Re: [HACKERS] Logical Replication WIP
Следующее
От: Petr Jelinek
Дата:
Сообщение: [HACKERS] Logical replication existing data copy