Re: [Re] Re: [Re] Re: [Re] Re: [Re] Re: Unknown winsock error 10061while dumping a big database

From: Richard Huxton <dev(at)archonet(dot)com>
To: cyril(dot)velter(at)metadys(dot)com
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, pgsql-general(at)postgresql(dot)org
Subject: Re: [Re] Re: [Re] Re: [Re] Re: [Re] Re: Unknown winsock error 10061while dumping a big database
Date: 2007-11-29 11:04:58
Message-ID: 474E9CDA.9010103@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Cyril VELTER wrote:
> De : mailto:dev(at)archonet(dot)com
>> Cyril VELTER wrote:
>>> Is length() supposed to return the very high length in case of corruption
> ?
>> You'd have thought it would. The odd thing (if it is data corruption) is
>> that you would expect to see something in the server logs about a
>> failure to allocate 12345412234124 bytes of memory or some such. Whereas
>> all you get is this winsock error.
>
> I have another theory. The message printed by pg_dump :
>
> "pg_dump: Error message from server: out of memory"
>
> is printed in dumpTableData_copy (pg_dump.c) : write_msg(NULL, "Error message
> from server: %s", PQerrorMessage(g_conn));
>
> There are serveral places in libpq where the conn error might be set to "out
> of memory". I've also discovered that the machine running pg_dump is pretty
> tight in ram (256M) and that no swap file is active (oversight after a disk
> upgrade). May be this error is simply pg_dump running out of memory and not the
> server. This would also explain that the server only report a socket error
> (though I would have expected WSAECONNRESET (10054) instead of WSAECONNREFUSED
> (10061)).

Aha - that sounds likely. If you're dumping multi-megabyte rows I can
see how you'd get into problems on a client with a small amount of RAM.

> The 8.0.13 pg_dump used to work just fine on the exact same machine. Maybe 8.2
> pg_dump need more memory (or maybe a memory leak ?).

Might just be slightly higher RAM usage in your particular case. It
could be there were some trade-offs between size and speed.

> I'm running the dump again after adding some swap space and will monitor
> memory usage.
>
> What do you think ?

I think you've found the problem. If you're short of RAM though you
might also have difficulty restoring the dump.

You could run pg_dump on the Windows server and copy its output to the
RAM-limited Linux box. You could even run pg_restore from the Windows
box - if you don't have a direct channel to the database you can use the
putty ssh-client to create a tunnelled connection to the Linux box.

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2007-11-29 11:08:22 Re: Killing a session on windows
Previous Message Andrus 2007-11-29 10:59:56 log_line_prefix='%t %u %d %h %p %i %l %x ' causes error