Re: Reducing bgwriter wakeups

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Reducing bgwriter wakeups
Date: 2012-02-20 00:17:41
Message-ID: CA+Tgmob4-910AbDkys4=C2QrsRaPgp=TJUORnoSwmRpaLu0ggQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Feb 19, 2012 at 5:56 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
> Would the log really have been archived in 9.1?  I don't think
> checkpoint_timeout caused a log switch, just a checkpoint which could
> happily be in the same file as the previous checkpoint.

The log segment doesn't need to get archived - it's sufficient that
the dirty buffers get written to disk.

>> In 9.2, it may well be that
>> xlog contains the only record of that transaction, and you're hosed.
>> The more work we do to postpone writing the data until the absolutely
>> last possible moment, the more likely it is that it won't be on disk
>> when we need it.
>
> Isn't that what archive_timeut is for?
>
> Should archive_timeout default to something like 5 min, rather than 0?

I dunno. I think people are doing replication are probably mostly
using streaming replication these days, in which case archive_timeout
won't matter one way or the other. But if you're not doing
replication, your only hope of recovering from a trashed pg_xlog is
that PostgreSQL wrote the buffers and (in the case of an OS crash) the
OS wrote them to disk.

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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-02-20 00:20:07 Re: 16-bit page checksums for 9.2
Previous Message Robert Haas 2012-02-20 00:14:09 Re: leakproof