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

Commitd6e7abe

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 parent2c5d6f1 commitd6e7abe

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
@@ -3265,6 +3265,12 @@ restore_toc_entries_parallel(ArchiveHandle *AH)
32653265
if (AH->version<K_VERS_1_8)
32663266
die_horribly(AH,modulename,"parallel restore is not supported with archives made by pre-8.0 pg_dump\n");
32673267

3268+
/*
3269+
* It's also not gonna work if we can't reopen the input file, so let's
3270+
* try that immediately.
3271+
*/
3272+
(AH->ReopenPtr) (AH);
3273+
32683274
slots= (ParallelSlot*)calloc(sizeof(ParallelSlot),n_slots);
32693275

32703276
/* 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
@@ -735,10 +735,15 @@ _ReopenArchive(ArchiveHandle *AH)
735735

736736
if (AH->mode==archModeWrite)
737737
die_horribly(AH,modulename,"can only reopen input archives\n");
738+
739+
/*
740+
* These two cases are user-facing errors since they represent unsupported
741+
* (but not invalid) use-cases. Word the error messages appropriately.
742+
*/
738743
if (AH->fSpec==NULL||strcmp(AH->fSpec,"")==0)
739-
die_horribly(AH,modulename,"cannot reopenstdin\n");
744+
die_horribly(AH,modulename,"parallel restore fromstdin is not supported\n");
740745
if (!ctx->hasSeek)
741-
die_horribly(AH,modulename,"cannot reopennon-seekable file\n");
746+
die_horribly(AH,modulename,"parallel restore fromnon-seekable file is not supported\n");
742747

743748
errno=0;
744749
tpos=ftello(AH->FH);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp