Fix for timestamp lag issue from emit_log_hook when GUC log_line_prefix has '%m'

Поиск
Список
Период
Сортировка
От Kambam Vinay
Тема Fix for timestamp lag issue from emit_log_hook when GUC log_line_prefix has '%m'
Дата
Msg-id CANiRfmsK36A0i8mnQtzaxhSm3CUCimPwJPp4WQNq53OdSNkgWg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Fix for timestamp lag issue from emit_log_hook when GUC log_line_prefix has '%m'  (Michael Paquier <michael@paquier.xyz>)
Список pgsql-hackers
Hi, 

We observed a slight lag in timestamp for a few logs from the emit_log_hook hook implementation when the log_line_prefix GUC has '%m'.

Upon debugging, we found that the saved_timeval_set variable is set to 'true' in get_formatted_log_time() but is not reset to 'false' until the next call to send_message_to_server_log(). Due to this, saved_timeval_set will be true during the execution of hook emit_log_hook() which prefixes the saved timestamp 'saved_timeval' from the previous log line (our hook implementation calls log_line_prefix()).

Attached patch sets the saved_timeval_set to false before executing the emit_log_hook()

Thanks,
Vinay
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Nathan Bossart
Дата:
Сообщение: Re: pg_column_toast_chunk_id: a function to get a chunk ID of a TOASTed value
Следующее
От: Joe Conway
Дата:
Сообщение: Re: Improving contrib/tablefunc's error reporting