Re: Fix for timestamp lag issue from emit_log_hook when GUC log_line_prefix has '%m'
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Kambam Vinay <vinaykambam@gmail.com>
Cc: pgsql-hackers@postgresql.org
Date: 2024-03-18T05:12:57Z
Lists: pgsql-hackers
Attachments
- v2-0001-set-saved_timeval_set-to-false-before-executing-e.patch (text/x-diff) patch v2-0001
On Sun, Mar 17, 2024 at 07:35:57PM +0530, Kambam Vinay wrote: > Thanks Michael for the review. Agree with your comment on the patch. > updated the patch with recommended change. That should be fine. I would suggest to document why the reset is done at this location, aka this is to ensure that the same formatted timestamp is used across the board, for all log destinations as well as hook callers that rely on log_line_prefix. While reviewing, I have noticed that a comment was not correct: JSON logs also use the formatted timestamp via get_formatted_log_time(). I may be able to get this one committed just before the feature freeze of v17, as timestamp consistency for hooks that call log_status_format() is narrow. For now, I have added an entry in the CF app to keep track of it: https://commitfest.postgresql.org/48/4901/ -- Michael
Commits
-
Coordinate emit_log_hook and all log destinations to share the same timeval
- 2a217c371799 17.0 landed