Re: Emit "checkpoint skipped because system is idle" message at LOG level if log_checkpoints is set

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Emit "checkpoint skipped because system is idle" message at LOG level if log_checkpoints is set
Date: 2022-01-05 23:18:06
Message-ID: 20220105231806.GQ14051@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 05, 2022 at 10:45:06AM +0530, Dilip Kumar wrote:
> On Wed, Jan 5, 2022 at 10:24 AM Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> >
> > Postgres server emits a message at DEBUG1 level when it skips a
> > checkpoint. At times, developers might be surprised after figuring out
> > from server logs that there were no checkpoints happening at all
> > during a certain period of time when DEBUG1 messages aren't captured.
> > How about emitting the message at LOG level if log_checkpoints is set?
> > Patch attached.
>
> +1 to convert to LOG when log_checkpoints is set.

I think it would be odd to write logs of increased severity, for the case where
we did not do anything. I think it really is a debug log.

I don't think the log level should be changed to avoid "developer" confusion,
as you said (I'm not sure if you mean a postgres developer or an application
developer, though).

Is there any evidence that this has caused user confusion in the last 4 years ?

|commit 6ef2eba3f57f17960b7cd4958e18aa79e357de2f
|Author: Andres Freund <andres(at)anarazel(dot)de>
|Date: Thu Dec 22 11:31:50 2016 -0800
|
| Skip checkpoints, archiving on idle systems.

Note that logging a message may not be benign ; I think it could cause the
disks to spin up, that would othewise have been in power saving mode,
especially if you log to syslog, which can issue fsync. Also, part of the
argument for enabling log_checkpoint by default was that a small, quiescent
instance would not write logs every 5 minutes.

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bossart, Nathan 2022-01-05 23:34:01 Re: skip replication slot snapshot/map file removal during end-of-recovery checkpoint
Previous Message Bossart, Nathan 2022-01-05 23:10:50 Re: archive modules