Re: PGStream synchronization

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Maciek Sakrejda <msakrejda(at)truviso(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: PGStream synchronization
Date: 2009-08-25 22:53:46
Message-ID: 4A946B7A.60408@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Maciek Sakrejda wrote:

> I'm not that familiar with the FEBE protocol (I'll look into this as
> well), but we don't need to cancel regular queries explicitly, right?

You can do query cancellation via a separate connection, but that's
really about halting long-running queries while preserving your
connection which is not really what we're after here. All that really
matters is getting the Terminate in at an appropriate point in the
stream so that the backend knows it's a deliberate shutdown and doesn't
complain about an unexpected-client-EOF.

> The Terminate message is always valid, except in COPY mode? If that's
> the case, we only need to ensure that the various PGStream messages
> are sent atomically (which is currently *not* the case in the case of
> Terminate), and handle COPY specially (by issuing CopyFail followed by
> Terminate). I'm happy to start work on a patch if we find an approach
> we agree on.

Right, so long as you get the atomicity correct I think that will work.
This will probably require more finegrained synchronization since
currently there's effectively one big lock that's held for the entire
duration of the query, which doesn't work so well here if you want
close() to interrupt any ongoing operation in a timely fashion.

-O

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Maciek Sakrejda 2009-08-26 09:01:51 Re: PGStream synchronization
Previous Message Maciek Sakrejda 2009-08-25 16:51:58 Re: PGStream synchronization