[PATH] Idle in transaction cancellation - Mailing list pgsql-hackers

From Andres Freund
Subject [PATH] Idle in transaction cancellation
Date
Msg-id 201010171958.44191.andres@anarazel.de
Whole thread Raw
Responses Re: [PATH] Idle in transaction cancellation
List pgsql-hackers
Hi all.

Here is a proposed patch which enables cancellation of $subject. The 
problematic point about doing so is that the client is not expecting any 
messages from the server when its in an idle state during an transaction and 
that simply suppressing that message is not enough as ready for query messages 
would get sent out at unexpected places.

Thus the first patch adds the possibility to add flags to ereport()s error level 
to suppress notifying the client.
It also switches the earlier "COMERROR" log level over to this flag 
(LOG_NO_CLIENT) with a typedef to support the old method.

The second patch sets up a variable "silent_error_while_idle" when its 
cancelling an idle txn which suppresses sending out messages at wrong places 
and resets its  after having read a command in the simple protocol and after 
having read a 'sync' message in the extended protocol.

Currently it does *not* report any special error message to the client if it 
starts sending commands in an (unbekownst to it) failed transaction, but just 
the normal "25P02: current transaction is aborted..." message.

It shouldn't be hard to add that and I will propose a patch if people would 
like it (I personally am not very interested, but I can see people validly 
wanting it), but I would like to have some feedback on the patch first.

Greetings,

Andres




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: WIP: extensible enums
Next
From: Dean Rasheed
Date:
Subject: Re: WIP: extensible enums