From: Mark Kirkwood <mark.kirkwood@catalyst.net.nz>
To: Simon Riggs <simon@2ndQuadrant.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: Pg_stat_replication shows sync standby with flush location behind primary in 9.1.5
Date: Thu, 04 Oct 2012 20:56:45 +1300
Message-ID: <506D413D.6010107@catalyst.net.nz> (raw)
In-Reply-To: <CA+U5nMJ0sZmZrC8iKEaEZ38c_0CE3KxU74_grHjGmXDzoihHYQ@mail.gmail.com>
References: <506D114D.1050803@catalyst.net.nz>
<CA+U5nMJ0sZmZrC8iKEaEZ38c_0CE3KxU74_grHjGmXDzoihHYQ@mail.gmail.com>
On 04/10/12 19:06, Simon Riggs wrote:
> On 4 October 2012 05:32, Mark Kirkwood <mark.kirkwood@catalyst.net.nz> wrote:
>> I am seeing the situation where the reported flush location for the sync
>> standby (standby1 below) is *behind* the reported current xlog location of
>> the primary. This is Postgres 9.1.5 , and I was under the impression that
>> transactions initiated on the master do not commit until the corresponding
>> wal is flushed on the sync standby.
>>
>> Now the standby is definitely working in sync mode, because stopping it
>> halts all write transactions on the primary (sync_standby_names contains
>> only standby1). So is the reported lag in flush location merely an artifact
>> of timing in the query, or is there something else going on? [1]
>
> The writing of new WAL is independent of the wait that occurs on
> commit, so it is entirely possible, even desirable, that the observed
> effect occurs.
>
Ah right - it did occur to me (after posting of course), that *other*
non commit wal could be causing the effect... thank you for clarifying!
This could be worth mentioning in docs for the view - as the context
I've encountered this effect is folks writing scripts for replication
lag etc.
Cheers
Mark
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: mark.kirkwood@catalyst.net.nz, simon@2ndQuadrant.com
Subject: Re: Pg_stat_replication shows sync standby with flush location behind primary in 9.1.5
In-Reply-To: <506D413D.6010107@catalyst.net.nz>
References: <506D114D.1050803@catalyst.net.nz> <CA+U5nMJ0sZmZrC8iKEaEZ38c_0CE3KxU74_grHjGmXDzoihHYQ@mail.gmail.com> <506D413D.6010107@catalyst.net.nz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox