Re: checkpoints taking much longer than expected - Mailing list pgsql-general

From Andres Freund
Subject Re: checkpoints taking much longer than expected
Date
Msg-id 20190617174334.ajdu667gcgjxt7f3@alap3.anarazel.de
Whole thread Raw
In response to Re: checkpoints taking much longer than expected  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-general
On 2019-06-16 12:25:58 -0400, Jeff Janes wrote:
> Right, but true only because they were "checkpoint starting: immediate".
> Otherwise the reported write time includes intentional sleeps added to
> honor the checkpoint_completion_target.  A bit confusing to report it that
> way, I think.

+1

It's even worse than that, actually. We also don't sleep if the *next*
requested checkpoint is an immediate one:

     * Perform the usual duties and take a nap, unless we're behind schedule,
     * in which case we just try to catch up as quickly as possible.
     */
    if (!(flags & CHECKPOINT_IMMEDIATE) &&
        !shutdown_requested &&
        !ImmediateCheckpointRequested() &&
        IsCheckpointOnSchedule(progress))

/*
 * Returns true if an immediate checkpoint request is pending.  (Note that
 * this does not check the *current* checkpoint's IMMEDIATE flag, but whether
 * there is one pending behind it.)
 */
static bool
ImmediateCheckpointRequested(void)

We ought to do better.

- Andres



pgsql-general by date:

Previous
From: Leandro Guimarães
Date:
Subject: Re: Copy Bulk Ignore Duplicated
Next
From: Adrian Klaver
Date:
Subject: Re: Copy Bulk Ignore Duplicated