Re: forgotten initalization of a variable
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2020-04-21T08:34:26Z
Lists: pgsql-hackers
Attachments
- pgrewind-restore-fix-v2.patch (text/x-diff) patch v2
On Tue, Apr 21, 2020 at 03:08:30PM +0900, Kyotaro Horiguchi wrote: > The commit a7e8ece41c adds a new member restoreCommand to > XLogPageReadPrivate. readOneRecord doesn't make use of it but forgets > to set NULL. That can lead to illegal pointer access. That's an oversight of the original commit. Now, instead of failing even if there is a restore command, wouldn't it be better to pass down the restore_command to readOneRecord() so as we can optionally improve the stability of a single record lookup? This only applies to a checkpoint record now, but this routine could be called elsewhere in the future. Please see the attached. -- Michael
Commits
-
Fix single-record reads to use restore_command if available in pg_rewind
- cd123234404e 13.0 landed
-
Add -c/--restore-target-wal to pg_rewind
- a7e8ece41cf7 13.0 cited