Re: Don't choke on files that are removed while pg_rewind runs.
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Masahiko Sawada <masahiko.sawada@2ndquadrant.com>
Cc: Daniel Gustafsson <daniel@yesql.se>, Justin Pryzby <pryzby@telsasoft.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Heikki Linnakangas <heikki.linnakangas@iki.fi>, Fujii Masao <masao.fujii@oss.nttdata.com>
Date: 2020-07-13T07:56:29Z
Lists: pgsql-hackers
Attachments
- libpq-null-crash.patch (text/x-diff) patch
On Mon, Jul 13, 2020 at 03:59:56PM +0900, Masahiko Sawada wrote: > On Mon, 13 Jul 2020 at 15:34, Daniel Gustafsson <daniel@yesql.se> wrote: >> Yeah, I agree with that, seems like the call should've been PQgetisnull(res, i, 1); >> to match the loop. > > +1 Good catch, Justin. There is a second thing here. The second column matches with the file size, so if its value is NULL then atol() would just crash first. I think that it would be more simple to first check if the file size is NULL (isdir and link_target would be also NULL, but just checking for the file size is fine), and then assign the result values, like in the attached. Any thoughts? -- Michael
Commits
-
Fix handling of missing files when using pg_rewind with online source
- 18ec25412c08 9.5.23 landed
- 14fe8041395c 9.6.19 landed
- 23924feca065 10.14 landed
- c6d33d144086 11.9 landed
- 92927477ff70 12.4 landed
- 5f89bb4cf010 13.0 landed
- 1d09fb1f0a9c 14.0 landed
-
Don't choke on files that are removed while pg_rewind runs.
- b36805f3c54f 9.5.0 cited