Re: Generalize ereport_startup_progress infrastructure

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Nitin Jadhav <nitinjadhavpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Generalize ereport_startup_progress infrastructure
Date: 2022-08-17 08:29:58
Message-ID: CALj2ACU2sGC1Qjp68Cs_jA0pntOvAt1wLNRPNEdjPghmTnsPbA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Aug 17, 2022 at 2:45 AM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
>
> On Wed, Aug 10, 2022 at 11:00:20AM -0400, Robert Haas wrote:
> > Maybe the checkpointer is a better candidate, but somehow I feel that
> > we can't consider this sort of thing separate from the existing
> > progress reporting that checkpointer already does. Perhaps we need to
> > think of changing or improving that in some way rather than adding
> > something wholly new alongside the existing system.
>
> I agree that the checkpointer has a good chance of being a better
> candidate. Are you thinking of integrating this into log_checkpoints
> somehow? Perhaps this parameter could optionally accept an interval for
> logging the progress of ongoing checkpoints.

Certainly the checkpointer is an immediate candidate. For instance, I
can think of using ereport_progress() in CheckPointSnapBuild() for
snapshot files processing, CheckPointLogicalRewriteHeap() for mapping
files processing, BufferSync() for checkpointing dirty buffers (?),
ProcessSyncRequests() for processing fsync() requests,
RemoveOldXlogFiles(), RemoveNonParentXlogFiles()(?). I personally have
seen cases where some of these checkpoint operations take a lot of
time in production environments and a better observability would help
a lot.

However, I'm not sure if turning log_checkpoints to an integer type to
use for checkpoint progress reporting is a good idea here.

As I explained upthread [1], I'd vote for a single GUC at the entire
server level. If the users/customers request per-process or
per-operation progress report GUCs, we can then consider it.

Thoughts?

[1] https://www.postgresql.org/message-id/CALj2ACUJA73nCK_Li7v4_OOkRqwQBX14Fx2ALb7GDRwUTNGK-Q%40mail.gmail.com

--
Bharath Rupireddy
RDS Open Source Databases: https://aws.amazon.com/rds/postgresql/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Quan Zongliang 2022-08-17 09:11:43 Re: Bug: When user-defined AM is used, the index path cannot be selected correctly
Previous Message Daniel Gustafsson 2022-08-17 08:23:16 Re: Propose a new function - list_is_empty