Re: pg_restore crash when there is a failure before all child process is created
vignesh C <vignesh21@gmail.com>
From: vignesh C <vignesh21@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Ahsan Hadi <ahsan.hadi@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2020-01-31T11:13:07Z
Lists: pgsql-hackers
On Fri, Jan 31, 2020 at 1:09 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > > vignesh C <vignesh21@gmail.com> writes: > > On Wed, Jan 29, 2020 at 6:54 PM Ahsan Hadi <ahsan.hadi@gmail.com> wrote: > >> Can you share a test case or steps that you are using to reproduce this issue? Are you reproducing this using a debugger? > > > I could reproduce with the following steps: > > Make cluster setup. > > Create few tables. > > Take a dump in directory format using pg_dump. > > Restore the dump generated above using pg_restore with very high > > number for --jobs options around 600. > > I agree this is quite broken. Another way to observe the crash is > to make the fork() call randomly fail, as per booby-trap-fork.patch > below (not intended for commit, obviously). > > I don't especially like the proposed patch, though, as it introduces > a great deal of confusion into what ParallelState.numWorkers means. > I think it's better to leave that as being the allocated array size, > and instead clean up all the fuzzy thinking about whether workers > are actually running or not. Like 0001-fix-worker-status.patch below. > The patch looks fine to me. The test is also getting fixed by the patch. Regards, Vignesh EnterpriseDB: http://www.enterprisedb.com
Commits
-
Fix parallel pg_dump/pg_restore for failure to create worker processes.
- cb4c04a4e6a5 9.6.17 landed
- 8b1d447a7160 10.12 landed
- 63634883fbcb 11.7 landed
- 5d60df8306c8 9.4.26 landed
- 2425f8f714a1 13.0 landed
- 1b78759a62be 9.5.21 landed
- 0c84199f71e0 12.2 landed