Re: Add ps display while waiting for wal in read_local_xlog_page_guts

From: "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: sirisha chamarthi <sirichamarthi22(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add ps display while waiting for wal in read_local_xlog_page_guts
Date: 2023-04-13 06:02:48
Message-ID: 12ff7bac-4ba9-39e6-c95b-4c223e724295@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 4/13/23 12:43 AM, sirisha chamarthi wrote:
> Hi,
>
> pg_create_logical_replication_slot can take longer than usual on a standby when there is no activity on the primary. We don't have enough information in the pg_stat_activity or process title to debug why this is taking so long. Attached a small patch to update the process title while waiting for the wal in read_local_xlog_page_guts. Any thoughts on introducing a new wait event too?
>
> For example, in my setup, slot creation took 8 minutes 13 seconds. It only succeeded after I ran select txid_current() on primary.

FWIW, this behavior has been mentioned in 0fdab27ad6 and a new function (pg_log_standby_snapshot()) has been created/documented to accelerate the slot creation on the standby.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Drouvot, Bertrand 2023-04-13 06:05:27 Re: Add ps display while waiting for wal in read_local_xlog_page_guts
Previous Message Tom Lane 2023-04-13 05:43:12 Re: [PATCH] Add `verify-system` sslmode to use system CA pool for server cert