| From: | Andrew Dunstan <andrew(at)dunslane(dot)net> |
|---|---|
| To: | Andrew Chernow <ac(at)esilo(dot)com> |
| Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: parallel restore vs. windows |
| Date: | 2008-12-09 17:36:40 |
| Message-ID: | 493EACA8.4070702@dunslane.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Andrew Chernow wrote:
>>
>> Parts of AH need deep cloning, notably the formatData member, which
>> is done in _ReopenArchive().
>>
>
> Is it okay to clone this from within the thread?
I don't see why not.
>
> The reopen() appears to mess with AH->FH, which mutltiple threads are
> calling fclose on. The second thread is going to fail and the first
> fclose() will close the main threads handle.
>
> + #ifndef WIN32
> + if (fclose(AH->FH) != 0)
> + die_horribly(AH, modulename, "could not close archive file:
> %s\n",
> + strerror(errno));
> + #else
>
> How are things failing? Core dump, maybe you are seeing the above
> error? The non-windows path is safe from this because a) it never
> does an fclose and b) its a fork and has its own copy of the FH.
No, as this fragment shows, fclose() is NOT called on Windows.
The program dies with a nasty dialog box when restoring a dump of the
regression database after the second COPY thread disconnects.
cheers
andrew
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Greg Stark | 2008-12-09 17:44:51 | Re: contrib/pg_stat_statements 1202 |
| Previous Message | Tom Lane | 2008-12-09 17:12:06 | Re: WIP: default values for function parameters |