Re: Live steraming replication setup issue! - Mailing list pgsql-general

From Venkata Balaji N
Subject Re: Live steraming replication setup issue!
Date
Msg-id CAEyp7J8PjGGDN4iJXGXY8+5T_JBrK35BW5YL4+eaqGMT5jaGPA@mail.gmail.com
Whole thread Raw
In response to Live steraming replication setup issue!  (Ashish Chauhan <Ashish.Chauhan@support.com>)
List pgsql-general

On Tue, Feb 23, 2016 at 10:02 AM, Ashish Chauhan <Ashish.Chauhan@support.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

pgsql-general by date:

Previous
From: Michael Paquier
Date:
Subject: Re: synch streaming replication question
Next
From: Stephen Frost
Date:
Subject: Re: Get the date of creation of objects in the database