pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Prevent memory context logging from sending log message to conne
Date: Fri, 28 Jan 2022 02:26:09 +0000
Message-ID: <E1nDGxl-0006Gg-Dp@gemulon.postgresql.org> (raw)

Prevent memory context logging from sending log message to connected client.

When pg_log_backend_memory_contexts() is executed, the target backend
should use LOG_SERVER_ONLY to log its memory contexts, to prevent them
from being sent to its connected client regardless of client_min_messages.
But previously the backend unexpectedly used LOG to log the message
"logging memory contexts of PID %d" and it could be sent to the client.
This is a bug in memory context logging.

To fix the bug, this commit changes that message so that it's logged with
LOG_SERVER_ONLY.

Back-patch to v14 where pg_log_backend_memory_contexts() was added.

Author: Fujii Masao
Reviewed-by: Bharath Rupireddy, Atsushi Torikoshi
Discussion: https://postgr.es/m/82c12f36-86f7-5e72-79af-7f5c37f6cad7@oss.nttdata.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6e7ee55e727771d97d0fce531a5cda350bb3fa84

Modified Files
--------------
src/backend/utils/mmgr/mcxt.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1nDGxl-0006Gg-Dp@gemulon.postgresql.org>
Permalink:  ../E1nDGxl-0006Gg-Dp@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nDGxl-0006Gg-Dp@gemulon.postgresql.org

 · 

reply

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-committers@postgresql.org
  Cc: fujii@postgresql.org
  Subject: Re: pgsql: Prevent memory context logging from sending log message to conne
  In-Reply-To: <E1nDGxl-0006Gg-Dp@gemulon.postgresql.org>
  References: <E1nDGxl-0006Gg-Dp@gemulon.postgresql.org>

* 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