Re: pg_stat_replication in 9.3

From: Torsten Förtsch <torsten(dot)foertsch(at)gmx(dot)net>
To: Andy Colson <andy(at)squeakycode(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg_stat_replication in 9.3
Date: 2014-09-14 14:59:07
Message-ID: 5415AD3B.3010109@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 14/09/14 16:24, Andy Colson wrote:
> I wonder if its a transaction thing? Maybe \watch is using a
> transaction for each (or isn't using transactions at all), whereas the
> plpgsql is one long transaction?
>
> Also if one of your replicas is far away, it doesn't really surprise me
> that it might loose connection every once and a while. On the other
> hand, if the box is on the same subnet, right next to the master, and it
> was loosing connection, that would be a bad thing.
>
> So, how far away is the replica? And does 'ps ax|grep postgr' show
> 'idle' or 'idle in transaction' on the \watch and the plpgsql?

The replicas are far away, intercontinental far. I am not complaining
that the replica looses the connection. What makes me wonder is that
within a transaction, pg_stat_replication can forget rows but cannot
acquire new ones. I'd think it should be either report the state at the
beginning of the transaction like now() or the current state like
clock_timestamp(). But currently it's reporting half the current state.

Torsten

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2014-09-14 16:55:29 Re: pg_stat_replication in 9.3
Previous Message Andy Colson 2014-09-14 14:24:19 Re: pg_stat_replication in 9.3