On Tue, Feb 23, 2016 at 10:02 AM, Ashish Chauhan <[email protected]
> 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