Re: corruption of WAL page header is never reported
Fujii Masao <masao.fujii@oss.nttdata.com>
From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: nagata@sraoss.co.jp, ranier.vf@gmail.com, pgsql-hackers@postgresql.org
Date: 2021-09-02T05:44:31Z
Lists: pgsql-hackers
On 2021/09/02 13:17, Kyotaro Horiguchi wrote: > Did you read the comment just above? Yes! > > xlog.c:12523 >> * Check the page header immediately, so that we can retry immediately if >> * it's not valid. This may seem unnecessary, because XLogReadRecord() >> * validates the page header anyway, and would propagate the failure up to >> * ReadRecord(), which would retry. However, there's a corner case with >> * continuation records, if a record is split across two pages such that > > So when not in standby mode, the same check is performed by xlogreader > which has the responsibility to validate the binary data read by > XLogPageRead. The page-header validation is a compromise to save a > specific case. Yes, so XLogPageRead() can skip the validation check of page head if not in standby mode. On the other hand, there is no problem if it still performs the validation check as it does for now. No? > I don't think it is good choice to conflate read-failure and header > validation failure from the view of modularity. I don't think that the proposed change does that. But maybe I failed to get your point yet... Anyway the proposed change just tries to reset errormsg_buf whenever XLogPageRead() retries, whatever error happened before. Also if errormsg_buf is set at that moment, it's reported. Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION
Commits
-
Make recovery report error message when invalid page header is found.
- 7b03d3a3ba45 12.17 landed
- 5dc093eacef1 13.13 landed
- 2f13e8d9ec28 14.10 landed
- 68601985e699 15.0 landed
-
Fix scenario where streaming standby gets stuck at a continuation record.
- 066871980183 11.0 cited