Re: Trouble with COPY IN

From: Matthew Wakeling <matthew(at)flymine(dot)org>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: Maciek Sakrejda <msakrejda(at)truviso(dot)com>, Samuel Gendler <sgendler(at)ideasculptor(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Trouble with COPY IN
Date: 2010-07-20 14:12:25
Message-ID: alpine.DEB.2.00.1007201507500.8895@aragorn.flymine.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-jdbc

On Tue, 20 Jul 2010, Matthew Wakeling wrote:
> After a little more investigation, it appears that
> core.v3.QueryExecutorImpl.unlock() is being called before
> core.v3.QueryExecutorImpl.endCopy(), in
> core.v3.QueryExecutorImpl.processCopyResults() apparently because it receives
> a "Z", called by core.v3.QueryExecutorImpl.writeToCopy(). Investigating
> further.

Okay, have investigated a little further. It seems that the server may be
responding to the client a little too quickly with the "all done" message.
Here is a sequence of events in core.v3.QueryExecutorImpl:

We call startCopy(). It calls processCopyResults().
In processCopyResults, we receive character G, and we lock.

We call writeToCopy(). It calls processCopyResults().
We receive character C.
We receive character Z, and unlock.

We call endCopy(), which tries to unlock and fails.

So, should the unlocking happen elsewhere, or should endCopy not require a
lock?

Matthew

--
Jadzia: Don't forget the 34th rule of acquisition: Peace is good for business.
Quark: That's the 35th.
Jadzia: Oh yes, that's right. What's the 34th again?
Quark: War is good for business. It's easy to get them mixed up.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-07-20 14:14:51 Re: psql \conninfo command (was: Patch: psql \whoami option)
Previous Message Robert Haas 2010-07-20 14:05:04 Re: Explicit psqlrc

Browse pgsql-jdbc by date

  From Date Subject
Next Message Matthew Wakeling 2010-07-20 14:55:18 Re: Trouble with COPY IN
Previous Message Matthew Wakeling 2010-07-20 13:56:49 Re: Trouble with COPY IN