mirror of
https://github.com/postgres/postgres.git
synced 2025-09-06 13:46:51 +03:00
Error out in pg_rewind if lstat() fails.
A "file not found" is expected if the source server is running, so don't complain about that. But any other error is definitely not expected.
This commit is contained in:
@@ -75,18 +75,21 @@ recurse_dir(const char *datadir, const char *parentpath,
|
|||||||
|
|
||||||
if (lstat(fullpath, &fst) < 0)
|
if (lstat(fullpath, &fst) < 0)
|
||||||
{
|
{
|
||||||
pg_log(PG_WARNING, "could not stat file \"%s\": %s",
|
if (errno == ENOENT)
|
||||||
fullpath, strerror(errno));
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is ok, if the new master is running and the file was just
|
* File doesn't exist anymore. This is ok, if the new master
|
||||||
* removed. If it was a data file, there should be a WAL record of
|
* is running and the file was just removed. If it was a data
|
||||||
* the removal. If it was something else, it couldn't have been
|
* file, there should be a WAL record of the removal. If it
|
||||||
* critical anyway.
|
* was something else, it couldn't have been anyway.
|
||||||
*
|
*
|
||||||
* TODO: But complain if we're processing the target dir!
|
* TODO: But complain if we're processing the target dir!
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
pg_fatal("could not stat file \"%s\": %s",
|
||||||
|
fullpath, strerror(errno));
|
||||||
|
}
|
||||||
|
|
||||||
if (parentpath)
|
if (parentpath)
|
||||||
snprintf(path, MAXPGPATH, "%s/%s", parentpath, xlde->d_name);
|
snprintf(path, MAXPGPATH, "%s/%s", parentpath, xlde->d_name);
|
||||||
|
Reference in New Issue
Block a user