aboutsummaryrefslogtreecommitdiff
path: root/src/backend/postmaster/checkpointer.c
diff options
context:
space:
mode:
authorFujii Masao <fujii@postgresql.org>2022-01-11 23:19:59 +0900
committerFujii Masao <fujii@postgresql.org>2022-01-11 23:19:59 +0900
commit790fbda902093c71ae47bff1414799cd716abb80 (patch)
treec880d8ea26d2b6605b3b50faa8a31bf7a80d5d3f /src/backend/postmaster/checkpointer.c
parent85c61ba8920ba73500e1518c63795982ee455d14 (diff)
downloadpostgresql-790fbda902093c71ae47bff1414799cd716abb80.tar.gz
postgresql-790fbda902093c71ae47bff1414799cd716abb80.zip
Enhance pg_log_backend_memory_contexts() for auxiliary processes.
Previously pg_log_backend_memory_contexts() could request to log the memory contexts of backends, but not of auxiliary processes such as checkpointer. This commit enhances the function so that it can also send the request to auxiliary processes. It's useful to look at the memory contexts of those processes for debugging purpose and better understanding of the memory usage pattern of them. Note that pg_log_backend_memory_contexts() cannot send the request to logger or statistics collector. Because this logging request mechanism is based on shared memory but those processes aren't connected to that. Author: Bharath Rupireddy Reviewed-by: Vignesh C, Kyotaro Horiguchi, Fujii Masao Discussion: https://postgr.es/m/CALj2ACU1nBzpacOK2q=a65S_4+Oaz_rLTsU1Ri0gf7YUmnmhfQ@mail.gmail.com
Diffstat (limited to 'src/backend/postmaster/checkpointer.c')
-rw-r--r--src/backend/postmaster/checkpointer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c
index 940b773fe1b..23f691cd475 100644
--- a/src/backend/postmaster/checkpointer.c
+++ b/src/backend/postmaster/checkpointer.c
@@ -577,6 +577,10 @@ HandleCheckpointerInterrupts(void)
/* Normal exit from the checkpointer is here */
proc_exit(0); /* done */
}
+
+ /* Perform logging of memory contexts of this process */
+ if (LogMemoryContextPending)
+ ProcessLogMemoryContextInterrupt();
}
/*