pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Scott Ribe <scott_ribe@elevated-dev.com>
To: Debraj Manna <subharaj.manna@gmail.com>
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: Replication lag from transaction logs
Date: Mon, 18 Jun 2018 11:03:27 -0600
Message-ID: <37FEEBC3-CA72-46B4-ABA3-ADDDD8FF4316@elevated-dev.com> (raw )
In-Reply-To: <CAF6DVKOJyk_ARY+yKhFvMh_awvu09XHXMJp+JLzZtHaEr5vFxw@mail.gmail.com >
References: <CAF6DVKPSrAbAecswpkPizv8X7LbfQFPTWDQXiLd-yCwjpjEV_A@mail.gmail.com >
<975db215-0ba1-0a36-178d-dd4078fc0d50@portavita.eu >
<CAHw75vvjnUDUkqmBH8VgY2wAcgTyc6s3Vw+zQmnann8B_XqH4g@mail.gmail.com >
<CAF6DVKPchrtTnTfrh3fygfZb2BSSW_nQgK_z0x+sjT4t=stMxQ@mail.gmail.com >
<CAHw75vts3q4FD6vyjJ7=9eJn4JO_AFkotn=1YjiytBbjC6RsjQ@mail.gmail.com >
<CAF6DVKOJyk_ARY+yKhFvMh_awvu09XHXMJp+JLzZtHaEr5vFxw@mail.gmail.com >
> On Jun 18, 2018, at 9:56 AM, Debraj Manna <subharaj.manna@gmail.com> wrote:
>
> Thanks Keith this is useful.
>
> One more query if I need to know that if a have fallen too far behind and the WAL is not available. I guess I can do this. Let me know if my understanding is correct.
> • Run pg_controldata <DATA_DIR> on the slave node which has been down for long.
> • It will output the details about the WAL along with the WAL file name from where it will start the replication. (Field to look for in the output– 'Latest checkpoint's REDO WAL file')
> • Then check if the file mentioned in ` 'Latest checkpoint's REDO WAL file' is present in master `pg_wal` directory. If not then slave have fallen too far behind and will not be able to recover from WAL.
You could also try bringing the slave back up, and monitoring the log for the error about needed WAL file not being available--this avoids the race condition between checking that all WAL is available and restarting the slave.
--
Scott Ribe
scott_ribe@elevated-dev.com
https://www.linkedin.com/in/scottribe/
view thread (9+ messages) latest in thread
Message-ID: <37FEEBC3-CA72-46B4-ABA3-ADDDD8FF4316@elevated-dev.com>
Permalink: ../37FEEBC3-CA72-46B4-ABA3-ADDDD8FF4316@elevated-dev.com/
Also on: postgresql.org/message-id/37FEEBC3-CA72-46B4-ABA3-ADDDD8FF4316@elevated-dev.com
copy link · copy postgr.es
reply 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 using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: scott_ribe@elevated-dev.com, subharaj.manna@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: Replication lag from transaction logs
In-Reply-To: <37FEEBC3-CA72-46B4-ABA3-ADDDD8FF4316@elevated-dev.com>
* 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