Re: Instrument checkpoint sync calls - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Instrument checkpoint sync calls
Date
Msg-id 1292336412-sup-4774@alvh.no-ip.org
Whole thread Raw
In response to Re: Instrument checkpoint sync calls  (Greg Smith <greg@2ndquadrant.com>)
Responses Re: Instrument checkpoint sync calls  (Robert Haas <robertmhaas@gmail.com>)
Re: Instrument checkpoint sync calls  (Greg Smith <greg@2ndquadrant.com>)
List pgsql-hackers
I gave this patch a look and it seems pretty good to me, except that I'm
uncomfortable with the idea of mdsync filling in the details for
CheckpointStats fields directly.  Would it work to pass a struct (say
SmgrSyncStats) from CheckPointBuffers to smgrsync and from there to
mdsync, have this function fill it, and return it back so that
CheckPointBuffers copies the data from this struct into CheckpointStats?

Another minor nitpick: inside the block when you call FileSync, why
check for log_checkpoints at all?  Seems to me that just checking for
zero of sync_start should be enough.  Alternatively, seems simpler to
just have a local var with the value of log_checkpoints at the start of
mdsync and use that throughout the function.  (Surely if someone turns
off log_checkpoints in the middle of a checkpoint, it's not really a
problem that we collect and report stats during that checkpoint.)

-- 
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: Marko Tiikkaja
Date:
Subject: Re: Transaction-scope advisory locks
Next
From: Andres Freund
Date:
Subject: Re: Transaction-scope advisory locks