Re: A few new options for CHECKPOINT

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: "Bossart, Nathan" <bossartn(at)amazon(dot)com>
Cc: "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: A few new options for CHECKPOINT
Date: 2020-11-25 15:51:44
Message-ID: 20201125155144.GA16415@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greetings,

* Bossart, Nathan (bossartn(at)amazon(dot)com) wrote:
> On 11/24/20, 4:03 PM, "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com> wrote:
> > From: Bossart, Nathan <bossartn(at)amazon(dot)com>
> >> The main purpose of this patch is to give users more control over their manually
> >> requested checkpoints or restartpoints. I suspect the most useful option is
> >> IMMEDIATE, which can help avoid checkpoint- related IO spikes. However, I
> >> didn't see any strong reason to prevent users from also adjusting FORCE and
> >> WAIT.
> >
> > I think just IMMEDIATE would suffice, too. But could you tell us why you got to want to give users more control? Could we know concrete example situations where users want to perform CHECKPOINT with options?
>
> It may be useful for backups taken with the "consistent snapshot"
> approach. As noted in the documentation [0], running CHECKPOINT
> before taking the snapshot can reduce recovery time. However, users
> might wish to avoid the IO spike caused by an immediate checkpoint.

I'm a bit confused by the idea here.. The whole point of running a
CHECKPOINT is to get the immediate behavior with the IO spike to get
things flushed out to disk so that, on crash recovery, there's less
outstanding WAL to replay.

Avoiding the IO spike implies that you're waiting for a regular
checkpoint and that additional WAL is building up since that started and
therefore you're going to have to replay that WAL during crash recovery
and so you won't end up reducing your recovery time, so I'm failing to
see the point..? I don't think you really get to have both.. pay the
price at backup time, or pay it during crash recovery.

Thanks,

Stephen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2020-11-25 16:21:35 Re: Transaction isolation and table contraints
Previous Message Drouvot, Bertrand 2020-11-25 15:47:44 Re: Add Information during standby recovery conflicts