Re: Hot Standby and cancelling idle queries

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Simon Riggs <simon(at)2ndQuadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Hot Standby and cancelling idle queries
Date: 2009-11-26 06:30:14
Message-ID: 4B0E2076.9000002@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Simon Riggs wrote:
> Recent change:
>
> An idle-in-transaction transaction can also hold a temporary file. Think
> of an open cursor, for example. Therefore, remove the distinction
> between CONFLICT_MODE_ERROR and CONFLICT_MODE_ERROR_IF_NOT_IDLE,
> idle-in-transaction backends need to be killed too when a tablespace is
> dropped.
>
> Open cursors still have snapshots, so they would not be treated as idle
> in transaction.

A backend is idle-in-transaction whenever a transaction is open and the
backend is waiting for a command from the client. Whether it has active
snapshots or open cursors doesn't affect that.

> If the user has a held cursor then they can keep it,
> since it has already read the database and released the snapshot.

A held cursor can keep a temp file open.

I suspect you missed the context of this change. It's about the code in
tablespc.c, to kill all backends that might have a temporary file in a
tablespace that's being dropped. It's not about tuple visibility but
temporary files.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2009-11-26 06:55:56 Re: force index problem in 8.4.1
Previous Message Daniel Farina 2009-11-26 05:49:17 Re: [PATCH 4/4] Add tests to dblink covering use of COPY TO FUNCTION