Re: Should walsernder check correctness of WAL records? - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Should walsernder check correctness of WAL records?
Date
Msg-id 20201002002853.GB1464@paquier.xyz
Whole thread Raw
In response to RE: Should walsernder check correctness of WAL records?  ("tsunakawa.takay@fujitsu.com" <tsunakawa.takay@fujitsu.com>)
Responses RE: Should walsernder check correctness of WAL records?
Re: Should walsernder check correctness of WAL records?
List pgsql-hackers
On Fri, Oct 02, 2020 at 12:16:25AM +0000, tsunakawa.takay@fujitsu.com wrote:
> IIUC, walsender tries hard to send WAL as fast as possible to reduce
> replication lag and transaction response time, so it doesn't try to
> peek each WAL record.  I think it's good.

CRC calculation would unlikely be the bottleneck here, no?  I would
assume that the extra lseek() calls needed to look after the record
data to be more harmful.

> In any case, the WAL can get corrupt during transmission, and
> writing and reading on the standby.  So, the standby needs to check
> the WAL record CRC.

Yep.  However, I would worry much more about the case of cold
archives.  In my experience, there are higher risks to get a WAL
segment corrupted because it was on disk and that this disk got
corrupted.  Transmission is a one-time short operation. Cold archives
could stay on disk for weeks before getting reused in WAL replay.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: "tsunakawa.takay@fujitsu.com"
Date:
Subject: RE: Should walsernder check correctness of WAL records?
Next
From: Fujii Masao
Date:
Subject: Re: New statistics for tuning WAL buffer size