Re: parallel restore vs. windows

Andrew Dunstan <andrew@dunslane.net>

From: Andrew Dunstan <andrew@dunslane.net>
To: Andrew Chernow <ac@esilo.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2008-12-09T16:34:06Z
Lists: pgsql-hackers

Andrew Chernow wrote:
>
> Looks like the ArchiveHandle variable 'AH' and the TocEntry 
> 'next_work_item' are not being deep copied at line 315 of your patch, 
> where you prepare the RestoreArgs struct for the thread.  Every thread 
> is accessing and possibly updating the members of these structs that 
> need to be deep copied.
>

Each thread deals with a different TocEntry, which no other thread deals 
with, so there should be no need to clone it, I believe.

Parts of AH need deep cloning, notably the formatData member, which is 
done in _ReopenArchive().

I am aware that there are some minor memory leaks, which I will remedy.

cheers

andrew