Re: pg_rewind - enable wal_log_hints or data-checksums

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Dylan Luong <Dylan(dot)Luong(at)unisa(dot)edu(dot)au>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: pg_rewind - enable wal_log_hints or data-checksums
Date: 2017-06-05 01:38:04
Message-ID: CAB7nPqSHTf3Hb08+cdnFUprtNNLS0jLvzyivDMiV7+j0a2Lcng@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Jun 5, 2017 at 9:37 AM, Dylan Luong <Dylan(dot)Luong(at)unisa(dot)edu(dot)au> wrote:
> pg_rewind requires that the target server either has the wal_log_hints
> option enabled in postgresql.conf or data checksums enabled when the cluster
> was initialized with initdb.

Yes, this is to make sure that you don't finish with a corrupted
target server if a hint bit is set on a page after a checkpoint. Any
of those options make sure that a full-page write is generated in this
case.

> What is the difference between the two options?

Data checksums calculate 2 bytes of checksum data and write it to each
page that is evicted from shared buffers. Each page read from disk has
its checksum checked. In some workloads, like a heavy read load where
a lot of page evictions happen, this can induce a couple of percents
of performance lost. In my own experience, that's 1~2%.

> What are the advantages and disadvantages between the two?
> Which one is the the preferred option?

If you care more about performance or if you use a file system that
has its own block-level checksum, wal_log_hints would be preferred.
Data checksums offer more guarantees in terms of integrity though when
looking for corrupted data. Things get found more quickly.
--
Michael

In response to

Browse pgsql-general by date

  From Date Subject
Next Message PAWAN SHARMA 2017-06-05 09:08:54 Re: Oracle database into PostgreSQL using Ora2PG tool.
Previous Message Dylan Luong 2017-06-05 00:37:15 pg_rewind - enable wal_log_hints or data-checksums