From: Maciek Sakrejda <msakrejda@truviso.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: PGStream synchronization
Date: Wed, 26 Aug 2009 17:37:26 -0700
Message-ID: <895e58dd0908261737t20f5b7dbsd9ae546a34264a7@mail.gmail.com> (raw)
In-Reply-To: <4A95CE4B.5050107@opencloud.com>
References: <895e58dd0908241736q3575cdc2v461d879c5b5f9dcb@mail.gmail.com>
<4A9334C4.2060503@opencloud.com>
<895e58dd0908250815m1a8aada0qc9d3f0bde9c7a303@mail.gmail.com>
<895e58dd0908250951m1aa4baabnf1695c9e681aa278@mail.gmail.com>
<4A946B7A.60408@opencloud.com>
<895e58dd0908260201g59762012ka2349eada052ab6d@mail.gmail.com>
<4A95CE4B.5050107@opencloud.com>
Right. I did say I wasn't happy with it...
Would introducing message-level synchronization be the way to go,
then? As I see it, there are four possible approaches:
1. Cancel before close--what I just protoyped in the previous patch.
Pros: straighforward
Cons: overkill for most applications; semantics are ugly (queries
should not be canceled)
2. Status quo:
Pros: status quo, works in single-threaded case
Cons: protocol violations, possibly swallowed Terminate messages *and*
bad data in multi-threaded COPY
3. Introduce protocol-message-level synchronization
Pros: cleanest solution conceptually
Cons: may incur significant additional synchronization overhead,
significant changes in core code
4. Synchronize close() like other QueryExecutorImpl like other
connection activities
Pros: also straightforward
Cons: may block indefinitely on long-running queries or open copy
(although could additionally be made to trigger a CopyFail if a copy
operation is in progress)
I tend to agree that (1) is unworkable as a general-purpose solution.
I'm not sure how you guys feel about (2), but protocol violations seem
like a really, really ugly problem, even if they are only on closing
the connection. (3) is probably ideal, barring performance problems.
(4) may also be workable, but having close() block on currently
running queries is probably not what we want to do.
Any thoughts?
--
Maciek Sakrejda | Software Engineer | Truviso
(650) 242-3500 Main
(650) 242-3501 F
msakrejda@truviso.com
www.truviso.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: msakrejda@truviso.com, oliver@opencloud.com
Subject: Re: PGStream synchronization
In-Reply-To: <895e58dd0908261737t20f5b7dbsd9ae546a34264a7@mail.gmail.com>
References: <895e58dd0908241736q3575cdc2v461d879c5b5f9dcb@mail.gmail.com> <4A9334C4.2060503@opencloud.com> <895e58dd0908250815m1a8aada0qc9d3f0bde9c7a303@mail.gmail.com> <895e58dd0908250951m1aa4baabnf1695c9e681aa278@mail.gmail.com> <4A946B7A.60408@opencloud.com> <895e58dd0908260201g59762012ka2349eada052ab6d@mail.gmail.com> <4A95CE4B.5050107@opencloud.com> <895e58dd0908261737t20f5b7dbsd9ae546a34264a7@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox