Thread: log_checkpoints and restartpoint

log_checkpoints and restartpoint

From
Fujii Masao
Date:
Hi,

When log_checkpoints is enabled, checkpoint logs the number of
WAL files created/deleted/recycled, but restartpoint doesn't.
This is OK before 9.0 because restartpoint had never created/
deleted/recycled WAL files. But, in 9.0 or later, restartpoint might
do that while walreceiver is running. So I think that it's useful to
log those numbers even in restartpoint in the now.

The attached patch changes LogCheckpointEnd so that it logs
the number of WAL files created/deleted/recycled even in
restartpoint.

And I found the problem about the initialization of CheckpointStats
struct. The attached patch also fixes this.

Comments?

Regards,

--
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center

Attachment

Re: log_checkpoints and restartpoint

From
Simon Riggs
Date:
On Wed, 2011-01-26 at 13:14 +0900, Fujii Masao wrote:

> When log_checkpoints is enabled, checkpoint logs the number of
> WAL files created/deleted/recycled, but restartpoint doesn't.
> This is OK before 9.0 because restartpoint had never created/
> deleted/recycled WAL files. But, in 9.0 or later, restartpoint might
> do that while walreceiver is running. So I think that it's useful to
> log those numbers even in restartpoint in the now.
> 
> The attached patch changes LogCheckpointEnd so that it logs
> the number of WAL files created/deleted/recycled even in
> restartpoint.
> 
> And I found the problem about the initialization of CheckpointStats
> struct. The attached patch also fixes this.

Thanks.

Can you add to CF app so we can track this as well? It's easier to track
everything in one place.

-- Simon Riggs           http://www.2ndQuadrant.com/books/PostgreSQL Development, 24x7 Support, Training and Services



Re: log_checkpoints and restartpoint

From
Fujii Masao
Date:
On Wed, Jan 26, 2011 at 7:59 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
> On Wed, 2011-01-26 at 13:14 +0900, Fujii Masao wrote:
>
>> When log_checkpoints is enabled, checkpoint logs the number of
>> WAL files created/deleted/recycled, but restartpoint doesn't.
>> This is OK before 9.0 because restartpoint had never created/
>> deleted/recycled WAL files. But, in 9.0 or later, restartpoint might
>> do that while walreceiver is running. So I think that it's useful to
>> log those numbers even in restartpoint in the now.
>>
>> The attached patch changes LogCheckpointEnd so that it logs
>> the number of WAL files created/deleted/recycled even in
>> restartpoint.
>>
>> And I found the problem about the initialization of CheckpointStats
>> struct. The attached patch also fixes this.
>
> Thanks.
>
> Can you add to CF app so we can track this as well? It's easier to track
> everything in one place.

Sure.

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


Re: log_checkpoints and restartpoint

From
Robert Haas
Date:
On Tue, Jan 25, 2011 at 11:14 PM, Fujii Masao <masao.fujii@gmail.com> wrote:
> When log_checkpoints is enabled, checkpoint logs the number of
> WAL files created/deleted/recycled, but restartpoint doesn't.
> This is OK before 9.0 because restartpoint had never created/
> deleted/recycled WAL files. But, in 9.0 or later, restartpoint might
> do that while walreceiver is running. So I think that it's useful to
> log those numbers even in restartpoint in the now.
>
> The attached patch changes LogCheckpointEnd so that it logs
> the number of WAL files created/deleted/recycled even in
> restartpoint.
>
> And I found the problem about the initialization of CheckpointStats
> struct. The attached patch also fixes this.

This patch looks good to me.  For now, I'm marking it Ready for
Committer.  Absent objections, I will also commit it.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


Re: log_checkpoints and restartpoint

From
Itagaki Takahiro
Date:
On Mon, Jan 31, 2011 at 05:17, Robert Haas <robertmhaas@gmail.com> wrote:
>> The attached patch changes LogCheckpointEnd so that it logs
>> the number of WAL files created/deleted/recycled even in
>> restartpoint.
>
> This patch looks good to me.  For now, I'm marking it Ready for
> Committer.  Absent objections, I will also commit it.

I don't have any objections for the patch, but we might also need
to add description about restartpoints into log_checkpoints option.

http://developer.postgresql.org/pgdocs/postgres/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT

--
Itagaki Takahiro


Re: log_checkpoints and restartpoint

From
Robert Haas
Date:
On Wed, Feb 2, 2011 at 8:16 PM, Itagaki Takahiro
<itagaki.takahiro@gmail.com> wrote:
> On Mon, Jan 31, 2011 at 05:17, Robert Haas <robertmhaas@gmail.com> wrote:
>>> The attached patch changes LogCheckpointEnd so that it logs
>>> the number of WAL files created/deleted/recycled even in
>>> restartpoint.
>>
>> This patch looks good to me.  For now, I'm marking it Ready for
>> Committer.  Absent objections, I will also commit it.
>
> I don't have any objections for the patch, but we might also need
> to add description about restartpoints into log_checkpoints option.
>
> http://developer.postgresql.org/pgdocs/postgres/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHAT

Good idea.  Committed, with an appropriate (I hope) doc change.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company