Skip site navigation (1) Skip section navigation (2)

Re: Logging checkpoints and other slowdown causes

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Greg Smith <gsmith(at)gregsmith(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Logging checkpoints and other slowdown causes
Date: 2007-05-28 20:25:31
Message-ID: 465B3ABB.6010709@enterprisedb.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Here's a work-in-progress updated version of this patch. It's not 
completed, but I've settled on:

- a log_checkpoints GUC variable to control whether anything is printed 
or not. This is in line with log_connections, log_autovacuum etc.

- when checkpoints are logged, LOG-level is used

- the following log output:

LOG:  checkpoint starting (CHECKPOINT command)
LOG:  checkpoint complete; buffers written=3.1 MB (9.6%) write=96.8 ms 
sync=32.0 ms

where "checkpoint starting" is obviously printed when checkpoint starts, 
and "checkpoint complete" when the checkpoint is fully complete.

- all information on the progress of checkpoint is collected to a global 
struct. A global struct sounds a bit ugly, but it avoids the ugliness of 
littering all functions with multiple return values to pass back 
information to the caller that's only used to print it out. This makes 
it easy to add more data points. MoveOfflineLogs should probably be 
changed to use that as well for the sake of consistency, instead of 
returning nsegsremoved and nsegsrecycled through pointers.

- RequestCheckpoint and CreateCheckpoint was changed to take a 
CheckpointReason enum as argument, instead of boolean flags. This allows 
printing a different message depending on the cause of checkpoint, and 
is also cleaner IMHO.

I'm posting now to allow others, and Greg Smith in particular, to review 
the changes this far, and take over from here.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

Attachment: cplog-1.patch
Description: text/x-diff (25.3 KB)

In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2007-05-28 20:48:39
Subject: Re: Logging checkpoints and other slowdown causes
Previous:From: Tom LaneDate: 2007-05-28 19:24:18
Subject: Re: libedit-preferred by default

pgsql-patches by date

Next:From: Simon RiggsDate: 2007-05-28 20:48:39
Subject: Re: Logging checkpoints and other slowdown causes
Previous:From: Heikki LinnakangasDate: 2007-05-28 19:59:43
Subject: Re: Seq scans status update

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group