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

Commitfbf776a

Browse files
committed
Be more user-friendly about unsupported cases for parallel pg_restore.
If we are unable to do a parallel restore because the input file is stdinor is otherwise unseekable, we should complain and fail immediately, notafter having done some of the restore. Complaining once per thread isn'tso cool either, and the messages should be worded to make it clear this isan unsupported case not some weird race-condition bug. Per complaint fromLonni Friedman.Back-patch to 8.4, where parallel restore was introduced.
1 parent42de04f commitfbf776a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

‎src/bin/pg_dump/pg_backup_archiver.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3200,6 +3200,12 @@ restore_toc_entries_parallel(ArchiveHandle *AH)
32003200
if (AH->version<K_VERS_1_8)
32013201
die_horribly(AH,modulename,"parallel restore is not supported with archives made by pre-8.0 pg_dump\n");
32023202

3203+
/*
3204+
* It's also not gonna work if we can't reopen the input file, so let's
3205+
* try that immediately.
3206+
*/
3207+
(AH->ReopenPtr) (AH);
3208+
32033209
slots= (ParallelSlot*)calloc(sizeof(ParallelSlot),n_slots);
32043210

32053211
/* Adjust dependency information */

‎src/bin/pg_dump/pg_backup_custom.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,10 +866,15 @@ _ReopenArchive(ArchiveHandle *AH)
866866

867867
if (AH->mode==archModeWrite)
868868
die_horribly(AH,modulename,"can only reopen input archives\n");
869+
870+
/*
871+
* These two cases are user-facing errors since they represent unsupported
872+
* (but not invalid) use-cases. Word the error messages appropriately.
873+
*/
869874
if (AH->fSpec==NULL||strcmp(AH->fSpec,"")==0)
870-
die_horribly(AH,modulename,"cannot reopenstdin\n");
875+
die_horribly(AH,modulename,"parallel restore fromstdin is not supported\n");
871876
if (!ctx->hasSeek)
872-
die_horribly(AH,modulename,"cannot reopennon-seekable file\n");
877+
die_horribly(AH,modulename,"parallel restore fromnon-seekable file is not supported\n");
873878

874879
errno=0;
875880
tpos=ftello(AH->FH);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp