mirror of
https://github.com/postgres/postgres.git
synced 2026-04-08 02:35:51 -04:00
Fix some error message inconsistencies
These errors are very unlikely going to show up, but in the event that they happen, some incorrect information would have been provided: - In pg_rewind, a stat() failure was reported as an open() failure. - In pg_combinebackup, a check for the new directory of a tablespace mapping was referred as the old directory. - In pg_combinebackup, a failure in reading a source file when copying blocks referred to the destination file. The changes for pg_combinebackup affect v17 and newer versions. For pg_rewind, all the stable branches are affected. Author: Man Zeng <zengman@halodbtech.com> Discussion: https://postgr.es/m/tencent_1EE1430B1E6C18A663B8990F@qq.com Backpatch-through: 14
This commit is contained in:
parent
f94e9141a0
commit
74a116a79b
3 changed files with 3 additions and 3 deletions
|
|
@ -210,7 +210,7 @@ copy_file_blocks(const char *src, const char *dst,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rb < 0)
|
if (rb < 0)
|
||||||
pg_fatal("could not read from file \"%s\": %m", dst);
|
pg_fatal("could not read from file \"%s\": %m", src);
|
||||||
|
|
||||||
pg_free(buffer);
|
pg_free(buffer);
|
||||||
close(src_fd);
|
close(src_fd);
|
||||||
|
|
|
||||||
|
|
@ -501,7 +501,7 @@ add_tablespace_mapping(cb_options *opt, char *arg)
|
||||||
tsmap->old_dir);
|
tsmap->old_dir);
|
||||||
|
|
||||||
if (!is_absolute_path(tsmap->new_dir))
|
if (!is_absolute_path(tsmap->new_dir))
|
||||||
pg_fatal("old directory is not an absolute path in tablespace mapping: %s",
|
pg_fatal("new directory is not an absolute path in tablespace mapping: %s",
|
||||||
tsmap->new_dir);
|
tsmap->new_dir);
|
||||||
|
|
||||||
/* Canonicalize paths to avoid spurious failures when comparing. */
|
/* Canonicalize paths to avoid spurious failures when comparing. */
|
||||||
|
|
|
||||||
|
|
@ -327,7 +327,7 @@ slurpFile(const char *datadir, const char *path, size_t *filesize)
|
||||||
fullpath);
|
fullpath);
|
||||||
|
|
||||||
if (fstat(fd, &statbuf) < 0)
|
if (fstat(fd, &statbuf) < 0)
|
||||||
pg_fatal("could not open file \"%s\" for reading: %m",
|
pg_fatal("could not stat file \"%s\" for reading: %m",
|
||||||
fullpath);
|
fullpath);
|
||||||
|
|
||||||
len = statbuf.st_size;
|
len = statbuf.st_size;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue