aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2021-10-12 09:50:17 +0900
committerFujii Masao <fujii@postgresql.org>2021-10-12 09:51:17 +0900
commit62e821ad28e1f08ea9734d7338bdebd783228a1c (patch)
treee1fb0bac3e1745d1754b6154d14acad1ecb9b85b
parente7712155ea08c2f86dc32dccb5df2b230733be31 (diff)
downloadpostgresql-62e821ad28e1f08ea9734d7338bdebd783228a1c.tar.gz
postgresql-62e821ad28e1f08ea9734d7338bdebd783228a1c.zip
Make autovacuum launcher more responsive to pg_log_backend_memory_contexts().
Previously when pg_log_backend_memory_contexts() sent the request to the autovacuum launcher, it could take more than several seconds to log its memory contexts. Because the function (HandleAutoVacLauncherInterrupts) to process any new interrupts that autovacuum launcher received didn't handle the request for logging of memory contexts. This commit changes the function so that it handles the request, to make autovacuum launcher more responsitve to pg_log_backend_memory_contexts(). Back-patch to v14 where pg_log_backend_memory_contexts() was added. Author: Koyu Tanigawa Reviewed-by: Bharath Rupireddy, Atsushi Torikoshi Discussion: https://postgr.es/m/0aae3e074face409b35153451be5cc11@oss.nttdata.com
-rw-r--r--src/backend/postmaster/autovacuum.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index fefc07e1080..23ebac83d6e 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -836,6 +836,10 @@ HandleAutoVacLauncherInterrupts(void)
if (ProcSignalBarrierPending)
ProcessProcSignalBarrier();
+ /* Perform logging of memory contexts of this process */
+ if (LogMemoryContextPending)
+ ProcessLogMemoryContextInterrupt();
+
/* Process sinval catchup interrupts that happened while sleeping */
ProcessCatchupInterrupt();
}