Re: Load Distributed Checkpoints, take 3 - Mailing list pgsql-patches

From Heikki Linnakangas
Subject Re: Load Distributed Checkpoints, take 3
Date
Msg-id 4680CE4A.3080906@enterprisedb.com
Whole thread Raw
In response to Re: Load Distributed Checkpoints, take 3  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Load Distributed Checkpoints, take 3
List pgsql-patches
Tom Lane wrote:
> Hmm.  But if we're going to do that, we might as well have a checkpoint
> for our troubles, no?  The reason for the current design is the
> assumption that a bgwriter_all scan is less burdensome than a
> checkpoint, but that is no longer true given this rewrite.

Per comments in CreateCheckPoint, another  also skip the extra
checkpoints to avoid writing two checkpoints to the same page, risking
losing both on a crash:

>      * If this isn't a shutdown or forced checkpoint, and we have not inserted
>      * any XLOG records since the start of the last checkpoint, skip the
>      * checkpoint.    The idea here is to avoid inserting duplicate checkpoints
>      * when the system is idle. That wastes log space, and more importantly it
>      * exposes us to possible loss of both current and previous checkpoint
>      * records if the machine crashes just as we're writing the update.
>      * (Perhaps it'd make even more sense to checkpoint only when the previous
>      * checkpoint record is in a different xlog page?)

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

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: remove unused "caller" arg from stringToQualifiedNameList
Next
From: ITAGAKI Takahiro
Date:
Subject: pgstat_drop_relation bugfix