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

Commitfef88b3

Browse files
committed
Report exit code from external recovery commands properly
When an external recovery command such as restore_command orarchive_cleanup_command fails, report the exit code properly,distinguishing signals and normal exists, using the existingwait_result_to_str() facility, instead of just reporting the returnvalue from system().Reviewed-by: Peter Geoghegan <pg@heroku.com>
1 parent7ab3214 commitfef88b3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎src/backend/access/transam/xlogarchive.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,8 @@ RestoreArchivedFile(char *path, const char *xlogfname,
300300
signaled=WIFSIGNALED(rc)||WEXITSTATUS(rc)>125;
301301

302302
ereport(signaled ?FATAL :DEBUG2,
303-
(errmsg("could not restore file \"%s\" from archive:return code %d",
304-
xlogfname,rc)));
303+
(errmsg("could not restore file \"%s\" from archive:%s",
304+
xlogfname,wait_result_to_str(rc))));
305305

306306
not_available:
307307

@@ -410,9 +410,10 @@ ExecuteRecoveryCommand(char *command, char *commandName, bool failOnSignal)
410410
ereport((signaled&&failOnSignal) ?FATAL :WARNING,
411411
/*------
412412
translator: First %s represents a recovery.conf parameter name like
413-
"recovery_end_command", and the 2nd is the value of that parameter. */
414-
(errmsg("%s \"%s\": return code %d",commandName,
415-
command,rc)));
413+
"recovery_end_command", the 2nd is the value of that parameter, the
414+
third an already translated error message. */
415+
(errmsg("%s \"%s\": %s",commandName,
416+
command,wait_result_to_str(rc))));
416417
}
417418
}
418419

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp