Thread: log_checkpoint's "0 transaction log file(s) added" is extremely misleading

log_checkpoint's "0 transaction log file(s) added" is extremely misleading

From
Andres Freund
Date:
Hi,

While in theory correct, I think $subject is basically meaningless
because other backends may have added thousands of new segments. Yes, it
wasn't the checkpointer, but that's not particularly relevant
imo. Additionally, afaics, it will only ever be 0 or 1.

I think we should either remove that part of the log output, or make it
display the number of segments added since the beginning of the
checkpoint.

Greetings,

Andres Freund



Re: log_checkpoint's "0 transaction log file(s) added" is extremely misleading

From
Simon Riggs
Date:
On 22 January 2016 at 01:12, Andres Freund <andres@anarazel.de> wrote:
Hi,

While in theory correct, I think $subject is basically meaningless
because other backends may have added thousands of new segments. Yes, it
wasn't the checkpointer, but that's not particularly relevant
imo. Additionally, afaics, it will only ever be 0 or 1.

Even better, we could make it add >1
 
I think we should either remove that part of the log output, or make it
display the number of segments added since the beginning of the
checkpoint.

--
Simon Riggs                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Re: log_checkpoint's "0 transaction log file(s) added" is extremely misleading

From
Andres Freund
Date:
On January 22, 2016 3:29:44 AM GMT+01:00, Simon Riggs <simon@2ndQuadrant.com> wrote:
>On 22 January 2016 at 01:12, Andres Freund <andres@anarazel.de> wrote:
>
>> Hi,
>>
>> While in theory correct, I think $subject is basically meaningless
>> because other backends may have added thousands of new segments. Yes,
>it
>> wasn't the checkpointer, but that's not particularly relevant
>> imo. Additionally, afaics, it will only ever be 0 or 1.
>>
>
>Even better, we could make it add >1

That'd indeed be good, but I don't think it really will address my complaint: We'd still potentially create new
segmentsoutside the prealloc call. Including from within the checkpointer, when flushing WAL to be able to write out a
page.

Andres

---
Please excuse brevity and formatting - I am writing this on my mobile phone.



Re: log_checkpoint's "0 transaction log file(s) added" is extremely misleading

From
Fujii Masao
Date:
On Fri, Jan 22, 2016 at 11:33 AM, Andres Freund <andres@anarazel.de> wrote:
> On January 22, 2016 3:29:44 AM GMT+01:00, Simon Riggs <simon@2ndQuadrant.com> wrote:
>>On 22 January 2016 at 01:12, Andres Freund <andres@anarazel.de> wrote:
>>
>>> Hi,
>>>
>>> While in theory correct, I think $subject is basically meaningless

What about just changing "added" to "preallocated" to avoid the confusion?

>>> because other backends may have added thousands of new segments. Yes,
>>it
>>> wasn't the checkpointer, but that's not particularly relevant
>>> imo. Additionally, afaics, it will only ever be 0 or 1.
>>>
>>
>>Even better, we could make it add >1
>
> That'd indeed be good, but I don't think it really will address my complaint: We'd still potentially create new
segmentsoutside the prealloc call. Including from within the checkpointer, when flushing WAL to be able to write out a
page.

IMO it's more helpful to display such information in something like
pg_stat_walwriter view rather than checkpoint log message.

Regards,

-- 
Fujii Masao