public inbox for [email protected]  
help / color / mirror / Atom feed
pg_rewind - enable wal_log_hints or data-checksums
2+ messages / 2 participants
[nested] [flat]

* pg_rewind - enable wal_log_hints or data-checksums
@ 2017-06-05 00:37  Dylan Luong <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Dylan Luong @ 2017-06-05 00:37 UTC (permalink / raw)
  To: pgsql-general

Hi

In the PostgreSQL documentation for pg_rewind:

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.


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

Thanks
Regards
Dylan



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: pg_rewind - enable wal_log_hints or data-checksums
@ 2017-06-05 01:38  Michael Paquier <[email protected]>
  parent: Dylan Luong <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Michael Paquier @ 2017-06-05 01:38 UTC (permalink / raw)
  To: Dylan Luong <[email protected]>; +Cc: pgsql-general

On Mon, Jun 5, 2017 at 9:37 AM, Dylan Luong <[email protected]> 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


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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2017-06-05 01:38 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-06-05 00:37 pg_rewind - enable wal_log_hints or data-checksums Dylan Luong <[email protected]>
2017-06-05 01:38 ` Michael Paquier <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox