Re: Live steraming replication setup issue!

From: Venkata Balaji N <nag1010(at)gmail(dot)com>
To: Ashish Chauhan <Ashish(dot)Chauhan(at)support(dot)com>
Cc: Andreas Kretschmer <andreas(at)a-kretschmer(dot)de>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Live steraming replication setup issue!
Date: 2016-02-23 03:20:32
Message-ID: CAEyp7J8PjGGDN4iJXGXY8+5T_JBrK35BW5YL4+eaqGMT5jaGPA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 23, 2016 at 10:02 AM, Ashish Chauhan <Ashish(dot)Chauhan(at)support(dot)com
> wrote:

> Thanks Venkata, I am able to setup replication now. Just wondering when I
> check replication_delay and lag, I am getting negative number, any idea why?
>
>
>
> receive | replay | replication_delay | lag
>
> --------------+--------------+-------------------+-----
>
> 796/BA9D8000 | 796/BA9D7FF0 | -00:00:01.612415 | -2
>

The WAL records in receive and replay means the same WAL record, please see
below :

postgres=# select pg_xlogfile_name('796/BA9D8000');
pg_xlogfile_name
--------------------------
0000000100000796000000BA
(1 row)

postgres=# select pg_xlogfile_name('796/BA9D7FF0');
pg_xlogfile_name
--------------------------
0000000100000796000000BA
(1 row)

That means the replication is continuously streaming and may behind few WAL
records. Do you see the lag all the time ? Did you test if the replication
is working fine ?

You can check that via pg_controldata as well. What does sync_state in
pg_stat_replication say ?

Regards,
Venkata B N

Fujitsu Australia

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2016-02-23 03:50:19 Re: Get the date of creation of objects in the database
Previous Message Michael Paquier 2016-02-23 03:15:22 Re: synch streaming replication question