Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb5e560c

Browse files
committed
Error out in pg_rewind if lstat() fails.
A "file not found" is expected if the source server is running, so don'tcomplain about that. But any other error is definitely not expected.
1 parent41457fc commitb5e560c

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

‎src/bin/pg_rewind/copy_fetch.c

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,20 @@ recurse_dir(const char *datadir, const char *parentpath,
7575

7676
if (lstat(fullpath,&fst)<0)
7777
{
78-
pg_log(PG_WARNING,"could not stat file \"%s\": %s",
79-
fullpath,strerror(errno));
80-
81-
/*
82-
* This is ok, if the new master is running and the file was just
83-
* removed. If it was a data file, there should be a WAL record of
84-
* the removal. If it was something else, it couldn't have been
85-
* critical anyway.
86-
*
87-
* TODO: But complain if we're processing the target dir!
88-
*/
78+
if (errno==ENOENT)
79+
{
80+
/*
81+
* File doesn't exist anymore. This is ok, if the new master
82+
* is running and the file was just removed. If it was a data
83+
* file, there should be a WAL record of the removal. If it
84+
* was something else, it couldn't have been anyway.
85+
*
86+
* TODO: But complain if we're processing the target dir!
87+
*/
88+
}
89+
else
90+
pg_fatal("could not stat file \"%s\": %s",
91+
fullpath,strerror(errno));
8992
}
9093

9194
if (parentpath)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp