Restore fails if using multiple threads and database is dumped through pipe

From: Joni Ruuskanen <joni(dot)ruuskanen(at)likeit(dot)fi>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Restore fails if using multiple threads and database is dumped through pipe
Date: 2020-01-20 14:13:43
Message-ID: d940b5c3b4bb00714662c0dd82d4a7841eae3586.camel@likeit.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

After upgrading from Postgresql 11 to 12 I noticed pg_restore fails if -j / jobs parameter is specified and database is dumped through pipe.
This doesn't happen if dump is saved through redirect (for example: > file.dmp) or file parameter (-f).
Is this intended behaviour?

Some examples:

Dump to file: pg_dump -Fc -f dumptest-file.dmp dumptest
Restore: pg_restore -j4 -d dumptest -O -Fc --role=tomcat dumptest-file.dmp
No errors

Dump to file via stdout: pg_dump -Fc dumptest > dumptest-stdout.dmp
Restore: pg_restore -j4 -d dumptest -O -Fc --role=tomcat dumptest-stdout.dmp
No errors

Dump to file via pipe: pg_dump -Fc dumptest | tee dumptest-pipe.dmp >/dev/null
Restore: pg_restore -j4 -d dumptest -O -Fc --role=tomcat dumptest-pipe.dmp
pg_restore: error: could not find block ID 5648 in archive -- possibly due to out-of-order restore request, which cannot be handled due to lack of data offsets in archive
pg_restore: error: a worker process died unexpectedly

Piped dump is successfully restored if using only 1 thread/job.

Regards,
Joni Ruuskanen

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2020-01-20 15:59:03 Re: Restore fails if using multiple threads and database is dumped through pipe
Previous Message Laurenz Albe 2020-01-20 09:13:36 Re: Ver. 12.1 successfully installed on Win 10 but having trouble with jdbc jar