Re: Don't choke on files that are removed while pg_rewind runs.
Justin Pryzby <pryzby@telsasoft.com>
From: Justin Pryzby <pryzby@telsasoft.com>
To: pgsql-hackers@lists.postgresql.org
Cc: Heikki Linnakangas <heikki.linnakangas@iki.fi>, Michael Paquier <michael@paquier.xyz>, Fujii Masao <masao.fujii@oss.nttdata.com>
Date: 2020-07-13T06:10:10Z
Lists: pgsql-hackers
commit b36805f3c54fe0e50e58bb9e6dad66daca46fbf6
Author: Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date: Sun Jun 28 21:35:51 2015 +0300
...
|@@ -175,22 +175,31 @@ libpqProcessFileList(void)
| pg_fatal("unexpected result set while fetching file list\n");
|
| /* Read result to local variables */
| for (i = 0; i < PQntuples(res); i++)
| {
| char *path = PQgetvalue(res, i, 0);
| int filesize = atoi(PQgetvalue(res, i, 1));
| bool isdir = (strcmp(PQgetvalue(res, i, 2), "t") == 0);
| char *link_target = PQgetvalue(res, i, 3);
| file_type_t type;
|
|+ if (PQgetisnull(res, 0, 1))
...
|+ continue;
Every other access to "res" in this loop is to res(i), which I believe is what
was intended here, too. Currently, it will dumbly loop but skip *every* row if
the 2nd column (1: size) of the first row (0) is null.
--
Justin
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