Hot-standby and canceled queries

From: "David F(dot) Skoll" <dfs(at)roaringpenguin(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Hot-standby and canceled queries
Date: 2013-04-24 11:42:38
Message-ID: 20130424074238.2aa7f764@shishi.roaringpenguin.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi,

I ran a query on a hot-standby (PostgreSQL 9.1) and it was canceled as
per the documentation about vacuum cleanups on the master.

Second time testing, I started a transaction on the master (with
BEGIN) but my query on the hot-standby was still canceled.

Is that because a transaction doesn't "really" begin with BEGIN, but only
after the first real statement after the BEGIN? Is it sufficient to
use: BEGIN; SELECT ... ; to start a transaction on the master, or
do I need to use UPDATE or INSERT to ensure that a vacuum cleanup isn't
applied until the transaction is finished?

Or am I totally out of luck? The documentation says: "PostgreSQL
allows cleanup of old row versions when there are no transactions that
need to see them to ensure correct visibility of data according to
MVCC rules." So does that mean I can still run into trouble even with
an active transaction on the master?

I don't really want to set max_standby_streaming_delay very high, but that
will be the action of last resort.

Regards,

David.

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Simon Riggs 2013-04-24 13:01:13 Re: Hot-standby and canceled queries
Previous Message Paul Hinze 2013-04-23 17:14:16 Simultaneous index creates on different schemas cause deadlock?