[pgpool-hackers: 4536] Re: New feature: log_backend_messages
Bo Peng
pengbo at sraoss.co.jp
Tue Nov 26 11:20:49 JST 2024
Hi Ishii-san,
Thank you for your proposal.
I think it is a useful feature for debugging.
> One thing maybe better to think about the feature is, whether we want to show the log line:
> 2024-11-25 13:50:43.735: pgproto pid 325721: LOG: DataRow message from backend 0
Yes, I agree with you to log messages using the message instead of the message kind.
On Mon, 25 Nov 2024 14:31:31 +0900 (JST)
Tatsuo Ishii <ishii at postgresql.org> wrote:
> Currently we have various message loggings like:
>
> - log_statement
> - log_per_node_statement
> - notice_per_node_statement
> - log_client_messages
>
> But we don't have logging messages from backend. The only way to know
> what kind of messages come from which backend is turning on debugging
> (log_min_messages). But we have too many log lines if we enable
> debugging.
>
> So my proposal is adding new parameter "log_backend_messages" which
> informs what message kind comes from which backend. Sample loggings are
> as follows:
>
> 2024-11-25 13:50:43.729: pgproto pid 325721: LOG: "Z" message from backend 0
> 2024-11-25 13:50:43.729: pgproto pid 325721: LOG: "Z" message from backend 1
> 2024-11-25 13:50:43.729: pgproto pid 325721: LOG: "Z" message from backend 2
> 2024-11-25 13:50:43.735: pgproto pid 325721: LOG: "1" message from backend 0
> 2024-11-25 13:50:43.735: pgproto pid 325721: LOG: "2" message from backend 0
> 2024-11-25 13:50:43.735: pgproto pid 325721: LOG: "D" message from backend 0
> 2024-11-25 13:50:43.735: pgproto pid 325721: LOG: last "D" message from backend 0 repeated 17 times
> 2024-11-25 13:50:43.735: pgproto pid 325721: LOG: "1" message from backend 0
> 2024-11-25 13:50:43.735: pgproto pid 325721: LOG: "2" message from backend 0
> 2024-11-25 13:50:43.735: pgproto pid 325721: LOG: "C" message from backend 0
> 2024-11-25 13:50:43.736: pgproto pid 325721: LOG: "1" message from backend 0
> 2024-11-25 13:50:43.736: pgproto pid 325721: LOG: "2" message from backend 0
> 2024-11-25 13:50:43.736: pgproto pid 325721: LOG: "D" message from backend 0
> 2024-11-25 13:50:43.736: pgproto pid 325721: LOG: last "D" message from backend 0 repeated 18 times
> 2024-11-25 13:50:43.737: pgproto pid 325721: LOG: "Z" message from backend 0
> 2024-11-25 13:50:43.737: pgproto pid 325721: LOG: "C" message from backend 0
> 2024-11-25 13:50:43.737: pgproto pid 325721: LOG: "Z" message from backend 0
>
> Note the line:
> 2024-11-25 13:50:43.736: pgproto pid 325721: LOG: last "D" message from backend 0 repeated 18 times
>
> This saves the log lines by indicating that some message repeated more
> than once. This is useful for messages such as "D" message (DataRow)
> because it is possible that backend returns lots of D messages
> (imagine you retrieve 1,000 rows).
>
> One thing maybe better to think about the feature is, whether we want to show the log line:
> 2024-11-25 13:50:43.735: pgproto pid 325721: LOG: DataRow message from backend 0
>
> Instead of:
> 2024-11-25 13:50:43.735: pgproto pid 325721: LOG: "D" message from backend 0
>
> The former looks nicer but we need to have a table to translate the
> message kind (e.g. "D") to the message meaning ("DataRow") as
> appearing in the PostgreSQL docs.
>
> Comments and/or suggestions are welcome.
>
> Best reagards,
> --
> Tatsuo Ishii
> SRA OSS K.K.
> English: http://www.sraoss.co.jp/index_en/
> Japanese:http://www.sraoss.co.jp
> _______________________________________________
> pgpool-hackers mailing list
> pgpool-hackers at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-hackers
--
Bo Peng <pengbo at sraoss.co.jp>
SRA OSS K.K.
TEL: 03-5979-2701 FAX: 03-5979-2702
URL: https://www.sraoss.co.jp/
More information about the pgpool-hackers
mailing list