Checksums and full_page_writes

Started by Vladimir Borodinover 11 years ago3 messagesgeneral
Jump to latest
#1Vladimir Borodin
root@simply.name

Hi all.

I’ve read thread [0]/messages/by-id/20111217213324.GA4497@fetter.org, src/backend/storage/page/README and everything I found in the documentation about checksums [1, 2] but I haven’t understood what is my risk if I enable checksums during initdb and turn off full_page_writes?

Am I right that I can get torn pages on disk in that case but I will somehow know about it during checksum checking when this page will be read from disk to shared buffers? And is there any way to recover such torn page (from replica or backup+archived logs, for example)?

[0]: /messages/by-id/20111217213324.GA4497@fetter.org
[1]: http://www.postgresql.org/docs/current/static/app-initdb.html#APP-INITDB-DATA-CHECKSUMS
[2]: http://www.postgresql.org/docs/current/static/wal-reliability.html

--
Vladimir

#2Bruce Momjian
bruce@momjian.us
In reply to: Vladimir Borodin (#1)
Re: Checksums and full_page_writes

On Fri, Dec 26, 2014 at 01:11:57PM +0300, Borodin Vladimir wrote:

Hi all.

I ve read thread [0], src/backend/storage/page/README and everything I found in
the documentation about checksums [1, 2] but I haven t understood what is my
risk if I enable checksums during initdb and turn off full_page_writes?

Am I right that I can get torn pages on disk in that case but I will somehow
know about it during checksum checking when this page will be read from disk to
shared buffers? And is there any way to recover such torn page (from replica or

Yes.

backup+archived logs, for example)?

There is no way to _fix_ the torn page, but you can ignore the error
with ignore_checksum_failure:

http://www.postgresql.org/docs/9.4/static/runtime-config-developer.html

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#2)
Re: Checksums and full_page_writes

On Fri, Dec 26, 2014 at 04:07:11PM -0500, Bruce Momjian wrote:

On Fri, Dec 26, 2014 at 01:11:57PM +0300, Borodin Vladimir wrote:

Hi all.

I ve read thread [0], src/backend/storage/page/README and everything I found in
the documentation about checksums [1, 2] but I haven t understood what is my
risk if I enable checksums during initdb and turn off full_page_writes?

Am I right that I can get torn pages on disk in that case but I will somehow
know about it during checksum checking when this page will be read from disk to
shared buffers? And is there any way to recover such torn page (from replica or

Yes.

backup+archived logs, for example)?

There is no way to _fix_ the torn page, but you can ignore the error
with ignore_checksum_failure:

http://www.postgresql.org/docs/9.4/static/runtime-config-developer.html

Oh, you can fail-over to the replica, of course, but there is no clean
way to restore just the torn page.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general