pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Joni Ruuskanen <joni.ruuskanen@likeit.fi>
To: pgsql-admin@lists.postgresql.org
Subject: Restore fails if using multiple threads and database is dumped through pipe
Date: Mon, 20 Jan 2020 16:13:43 +0200
Message-ID: <d940b5c3b4bb00714662c0dd82d4a7841eae3586.camel@likeit.fi> (raw)

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






view thread (2+ messages)  latest in thread

Message-ID: <d940b5c3b4bb00714662c0dd82d4a7841eae3586.camel@likeit.fi>
Permalink:  ../d940b5c3b4bb00714662c0dd82d4a7841eae3586.camel@likeit.fi/
Also on:    postgresql.org/message-id/d940b5c3b4bb00714662c0dd82d4a7841eae3586.camel@likeit.fi

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: joni.ruuskanen@likeit.fi, pgsql-admin@lists.postgresql.org
  Subject: Re: Restore fails if using multiple threads and database is dumped through pipe
  In-Reply-To: <d940b5c3b4bb00714662c0dd82d4a7841eae3586.camel@likeit.fi>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox