Re: Logging idle checkpoints

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: sfrost(at)snowman(dot)net
Cc: michael(dot)paquier(at)gmail(dot)com, vik(dot)fearing(at)2ndquadrant(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Logging idle checkpoints
Date: 2017-10-05 05:00:41
Message-ID: 20171005.140041.56971318.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Tue, 3 Oct 2017 08:22:27 -0400, Stephen Frost <sfrost(at)snowman(dot)net> wrote in <20171003122227(dot)GJ4628(at)tamriel(dot)snowman(dot)net>
> Greetings,
>
> * Kyotaro HORIGUCHI (horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp) wrote:
> > At Tue, 3 Oct 2017 10:23:08 +0900, Michael Paquier <michael(dot)paquier(at)gmail(dot)com> wrote in <CAB7nPqQ3Q1J_wBC7yPXk39dO0RGvbM4-nYp2gMrCJ7pfPJXcYw(at)mail(dot)gmail(dot)com>
> > > On Tue, Oct 3, 2017 at 12:01 AM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> > > Since their introduction in
> > > 335feca4, m_timed_checkpoints and m_requested_checkpoints track the
> > > number of checkpoint requests, not if a checkpoint has been actually
> > > executed or not, I am not sure that this should be changed after 10
> > > years. So, to put it in other words, wouldn't we want a way to track
> > > checkpoints that are *executed*, meaning that we could increment a
> > > counter after doing the skip checks in CreateRestartPoint() and
> > > CreateCheckPoint()?
> >
> > This sounds reasonable to me.
>
> I agree that tracking executed checkpoints is valuable, but, and perhaps
> I'm missing something, isn't that the same as tracking non-skipped
> checkpoints? I suppose we could have both, if we really feel the need,
> provided that doesn't result in more work or effort being done than
> simply keeping the count. I'd hate to end up in a situation where we're
> writing things out unnecessairly just to keep track of checkpoints that
> were requested but ultimately skipped because there wasn't anything to
> do.

I'm fine with counting both executed and skipped. But perhaps the
time of lastest checkpoint fits the concern better, like
vacuum. It is seen in control file but not in system views. If we
have count skipped checkpoints, I'd like to see the time (or LSN)
of last checkpoint in system views.

checkpoints_timed | bigint | | |
checkpoints_req | bigint | | |
+ checkpoints_skipped | bigint
+ last_checkpint | timestamp with time zone or LSN?

# This reminded me of a concern. I'd like to count vacuums that
# are required but skipped by lock-failure, or killed by other
# backend.

regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-10-05 05:29:14 Re: Additional logging for VACUUM and ANALYZE
Previous Message Michael Paquier 2017-10-05 04:55:35 Re: [COMMITTERS] pgsql: Allow multiple tables to be specified in one VACUUM or ANALYZE c