Re: Is full_page_writes=off safe in conjunction with PITR?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hannu Krosing <hannu(at)skype(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Is full_page_writes=off safe in conjunction with PITR?
Date: 2006-04-15 13:48:00
Message-ID: 200604151348.k3FDm1j09668@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Hannu Krosing <hannu(at)skype(dot)net> writes:
> > hel kenal peval, R, 2006-04-14 kell 16:40, kirjutas Tom Lane:
> >> If the backup-taker reads, say, 4K at a time then it's
> >> certainly possible that it gets a later version of the second half of a
> >> page than it got of the first half. I don't know about you, but I sure
> >> don't feel comfortable making assumptions at that level about the
> >> behavior of tar or cpio.
> >>
> >> I fear we still have to disable full_page_writes (force it ON) if
> >> XLogArchivingActive is on. Comments?
>
> > Why not just tell the backup-taker to take backups using 8K pages ?
>
> How? (No, I don't think tar's blocksize options control this
> necessarily --- those indicate the blocking factor on the *tape*.
> And not everyone uses tar anyway.)
>
> Even if this would work for all popular backup programs, it seems
> far too fragile: the consequence of forgetting the switch would be
> silent data corruption, which you might not notice until the slave
> had been in live operation for some time.

Yea, it is a problem. Even a 10k read is going to read 2k into the next
page.

I am thinking we should throw an error on pg_start_backup() and
pg_stop_backup if full_page_writes is off. Seems archive_command and
full_page_writes can still be used if we are not in the process of doing
a file system backup.

In fact, could we have pg_start_backup() turn on full_page_writes and
have pg_stop_backup turn it off, if postgresql.conf has it off.

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-04-15 15:45:46 Re: Is full_page_writes=off safe in conjunction with PITR?
Previous Message Hannu Krosing 2006-04-15 10:31:58 Re: Is full_page_writes=off safe in conjunction with