From: bt21tanigaway <bt21tanigaway@oss.nttdata.com>
To: pgsql-hackers@lists.postgresql.org
Subject: Fix pg_log_backend_memory_contexts() 's delay
Date: Tue, 05 Oct 2021 18:20:11 +0900
Message-ID: <0aae3e074face409b35153451be5cc11@oss.nttdata.com> (raw)
Hi,
Log output takes time between several seconds to a few tens when using
‘SELECT pg_log_backend_memory_contexts(1234)’ with PID of ‘autovacuum
launcher’.
I made a patch for this problem.
regards,
Koyu Tanigawa
Attachments:fix_log_output_delay.patch (text/x-diff, 506B) downloaddiff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.cindex 3b3df8fa8c..7ebe5ae8dc 100644--- a/src/backend/postmaster/autovacuum.c+++ b/src/backend/postmaster/autovacuum.c@@ -836,6 +836,9 @@ HandleAutoVacLauncherInterrupts(void)
if (ProcSignalBarrierPending)
ProcessProcSignalBarrier();
+ if (LogMemoryContextPending)+ ProcessLogMemoryContextInterrupt();+
/* Process sinval catchup interrupts that happened while sleeping */
ProcessCatchupInterrupt();
}
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: bt21tanigaway@oss.nttdata.com
Subject: Re: Fix pg_log_backend_memory_contexts() 's delay
In-Reply-To: <0aae3e074face409b35153451be5cc11@oss.nttdata.com>
References: <0aae3e074face409b35153451be5cc11@oss.nttdata.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox