[pgpool-hackers: 4542] Re: New feature: log_backend_messages
Tatsuo Ishii
ishii at postgresql.org
Sat Nov 30 18:39:54 JST 2024
>>>>> Hi Peng,
>>>>>
>>>>> Thank you for the feedback.
>>>>>
>>>>>> 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.
>>>>>
>>>>> Ok, attached is the patch to implement it. The log messages look like
>>>>> below.
>>>>>
>>>>> One thing I am wondering is, when a particular message is repeating,
>>>>> pgpool will not print the log immediately, just keep the number of
>>>>> messages while the same message type keeps on arriving. Once a
>>>>> different message type arrives, pgpool prints like:
>>>>>
>>>>> 2024-11-27 17:08:35.245: pgproto pid 487733: LOG: last ParameterStatus message from backend 0 repeated 13 times
>>>>>
>>>>> But what if the pgpool session terminates before the next different
>>>>> message arrives? pgpool print nothing. Thought?
>>>>
>>>> After thinking more, maybe this is not a practical issue because
>>>> DataRow messages are always followed by CommandComplete or
>>>> ErrorResponse. Same thing can be said to ParameterStatus
>>>> messages. They are follwed by BackendKeyData or ErrorResponse. Also
>>>> this is applied to CopyData. The only case these are broken is, the
>>>> child process is killed while counting the number of messages. Maybe
>>>> we could make log_backend_messages to take not only just on or off,
>>>> but something like:
>>>>
>>>> off: the default
>>>> terse: current patch behavior (e.g. "last DataRow message from backend 0 repeated 7 times")
>>>> verbose: log each message as soon as it is detected. This never miss
>>>> log messages even when the child process is killed, but could produce lots of log lines.
>>>
>>> If we go the direction, we should allow to change the
>>> log_backend_messages value using "pgpool set" command to make
>>> testing/debugging easier: i.e. we set the value to terse or off in
>>> normal circumstance, once we need to testing/debugging we run "pgpool
>>> set log_backend_messages to verbose".
>>
>> Attached is the v2 patch including documents and tests. Note that I
>> use the option name "none" to disable the feature instead of "off"
>> since "off" is tend to be used with "on" but log_backend_messages does
>> not "on" option. Thus I feel using solely "off" to be unnatural.
>>
>> I believe the v2 patch is close to commit-able form.
>
> Sorry, v2 patch is based on the v1 patch, not diff againt master
> branch. Attached is the v3 patch against master branch.
I have pushed the v3 patch to master branch.
Best reagards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp
More information about the pgpool-hackers
mailing list