Re: [HACKERS] Infrastructure changes for recovery

Alvaro Herrera <[email protected]> Fri, 12 Sep 2008 14:14:21 -0400
Newsgroups gmane.comp.db.postgresql.devel.patches
Message-ID <[email protected]>
Simon Riggs wrote:

> --- 5716,5725 ----
>   						CheckpointStats.ckpt_sync_end_t,
>   						&sync_secs, &sync_usecs);
>   
> ! 	elog(LOG, "%s complete: wrote %d buffers (%.1f%%); "
>   		 "%d transaction log file(s) added, %d removed, %d recycled; "
>   		 "write=%ld.%03d s, sync=%ld.%03d s, total=%ld.%03d s",
> + 		 (checkpoint ? "  checkpoint" : "restartpoint"),
>   		 CheckpointStats.ckpt_bufs_written,
>   		 (double) CheckpointStats.ckpt_bufs_written * 100 / NBuffers,
>   		 CheckpointStats.ckpt_segs_added,

Very minor nit: this really needs a rework.  It is relatively OK in the
previous code, but it was already stuffing too much in a single message.
Maybe

ereport(LOG,
(errmsg(checkpoint ? "checkpoint complete" : "restartpoint complete"),
errdetail("Wrote %d buffers (%.1f%%); "
	"%d transaction log file(s) added, %d removed, %d recycled; "
	"write=%ld.%03d s, sync=%ld.%03d s, total=%ld.%03d s.",
	...
)))

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

-- 
Sent via pgsql-patches mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches