Re: How does hot_standby_feedback work

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Александр Киселев <flykens(at)yandex(dot)ru>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How does hot_standby_feedback work
Date: 2017-04-05 16:59:42
Message-ID: CAOR=d=1wzB+A3ZkH1FQf6W4oFq_Gh-LiKZbjqNQPxn8mwQfd4w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Apr 5, 2017 at 3:37 AM, Александр Киселев <flykens(at)yandex(dot)ru> wrote:
> Hello!
>
> My name is Alexander. I am an administarator PostgreSQL.
> I am studying PostgreSQL's 9.6 documentation.
> I am interested in parameter hot_standby_feedback in postgresql.conf
> Can you explain more detail than in documentation for what this parameter is
> used?
> In what situations the parameter can show itself?
> How to test influence of the parameter on database's behavour.

It's possible for a long running query on a slave to live past the
time the tuples it needs exist on the master. This is because the
transaction the read only query is running under cannot "lock" those
tuples against vacuum on the master. The master gets vacuumed, those
tuples go away, the streaming / wal log replication gets relayed to
the read only slave, it loses the tuples and your query fails because
it can no longer access the snapshot of those tuples it started under.

With feedback, the slave can tell the master "I'm using these tuples,
please don't delete them just yet" and the master will skip vacuuming
them up.

It's darned useful for long running queries on a slave.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message John McKown 2017-04-05 17:05:39 Re: browser interface to forums please?
Previous Message Steve Litt 2017-04-05 16:51:41 Re: browser interface to forums please?