Re: 9.2 streaming replication issue and solution strategy

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: "T(dot) E(dot) Lawrence" <t(dot)e(dot)lawrence(at)icloud(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: 9.2 streaming replication issue and solution strategy
Date: 2012-11-17 15:12:56
Message-ID: 50A7A978.6010906@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 11/17/2012 06:08 AM, T. E. Lawrence wrote:
> Hello,
>
> We are running 9.2 w/ streaming replication.
>
> The slave is used for heavy tsearch based data mining.
>
> Apparently depending on the business of the master the slave queries fail with different frequency with the following message —
>
> ERROR: canceling statement due to conflict with recovery
> DETAIL: User query might have needed to see row versions that must be removed.
>
> Initially we resolved the problem by introducing a retry (wait 1 second, try), which works in some cases, and fails on other due to too many retries necessary (10+).
>
> After that we introduced a second slave, and told the try to switch slaves (try here, if not, wait 1 second and try there).
>
> Which works almost every time.
>
> So apparently the issues are not synchronous (probably logical as the streaming replication is asynchronous).
>
> Has anybody else experience such an issue and are there different approaches to it?

Have you looked at the below?:

http://www.postgresql.org/docs/9.2/interactive/hot-standby.html#HOT-STANDBY-CONFLICT

25.5.2. Handling Query Conflicts

>
> Than you,
> T.E.L.
>

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2012-11-17 15:17:51 Re: Parser - Query Analyser
Previous Message David Johnston 2012-11-17 14:44:06 Re: Parser - Query Analyser