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

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Antonin Houska <ah(at)cybertec(dot)at>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Slow I/O can break throttling of base backup
Date: 2016-12-19 09:17:47
Message-ID: CABUevEw9Gcf65uFgPTy9uC3WuKQsbJN-q9ROgUC3ApAVMerN=A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 16, 2016 at 11:24 AM, Antonin Houska <ah(at)cybertec(dot)at> wrote:

> Antonin Houska <ah(at)cybertec(dot)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(at)hagander(dot)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.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2016-12-19 09:30:07 Logical replication existing data copy
Previous Message Petr Jelinek 2016-12-19 08:43:01 Re: Logical Replication WIP