Re: Fwd: Questions about connection clean-up and "invalid page header"

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "<pgsql-hackers(at)postgresql(dot)org>" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fwd: Questions about connection clean-up and "invalid page header"
Date: 2010-01-26 03:56:39
Message-ID: 407d949e1001251956g38199672t4cbac757dbcd82e4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Mon, Jan 25, 2010 at 6:31 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Greg Stark <gsstark(at)mit(dot)edu> writes:
>> Given this thread on pgsql-general I wonder if we should have
>> something like 1 in every 1,000 CHECK_FOR_INTERRUPTS check if the
>> client socket is still open.
>
> ... and do what?  If so, why?

Hm, an interesting question.

Any time the client closes the server->client connection the server
_could_ abort the transaction and the client would be none-the-wiser.
Since it isn't sticking around to see if the transaction commits then
for all it knows the server is already aborting some of the
connections. At least in cases where it's running a SELECT then no
useful work is going to get done anyways since once the first results
are ready the server's only going to get a socket error and abort at
that point.

When the client closes the client->server connection I don't think
it's wise to take any action. Though I suppose if the connection is in
an explicit transaction and the operation currently running produces
no output (ie UPDATE or DELETE or INSERT) then an argument could be
made that no useful work could be done there either since the work
will only be rolled back.

--
greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Yan Cheng Cheok 2010-01-26 08:24:32 Create Trigger Function For Table Partition.
Previous Message Scott Marlowe 2010-01-26 03:54:30 Re: general questions postgresql performance config

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2010-01-26 04:11:19 Re: default pg_hba.conf tabulation
Previous Message Robert Haas 2010-01-26 03:24:22 Re: Red-black tree for GIN