On Fri, Jun 23, 2017 at 08:10:17AM +0530, Amit Kapila wrote: > On Wed, Jun 21, 2017 at 10:03 PM, Bruce Momjian <br...@momjian.us> wrote: > > On Wed, Jun 21, 2017 at 07:49:21PM +0530, Amit Kapila wrote: > >> On Tue, Jun 20, 2017 at 7:24 PM, Amit Kapila <amit.kapil...@gmail.com> > >> wrote: > >> > Hmm. I think we need something that works with lesser effort because > >> > not all users will be as knowledgeable as you are, so if they make any > >> > mistakes in copying the file manually, it can lead to problems. How > >> > about issuing a notification (XLogArchiveNotifySeg) in shutdown > >> > checkpoint if archiving is enabled? > >> > > >> > >> I have thought more about the above solution and it seems risky to > >> notify archiver for incomplete WAL segments (which will be possible in > >> this case as there is no guarantee that Checkpoint record will fill > >> the segment). So, it seems to me we should update the document unless > >> you or someone has some solution to this problem. > > > > The over-arching question is how do we tell users to verify that the WAL > > has been replayed on the standby? I am thinking we would say that for > > streaming replication, the "Latest checkpoint location" should match on > > the primary and standby, while for log shipping, the standbys should be > > exactly one WAL file less than the primary. > > > > I am not sure if we can say "standbys should be exactly one WAL file > less than the primary" because checkpoint can create few more WAL > segments for future use. I think to make this work user needs to > carefully just copy the next WAL segment (next to the last file in > standby) which will contain checkpoint record. Ideally, there should > be some way either in form of a tool or a functionality in the > database server with which this last file can be copied but I think in > the absence of that we can at least document this fact.
I was not clear. I was not saying there can be only one extra WAL file. I am saying the "Latest checkpoint location" should be one WAL file farther on the master. I think the big problem is that we need a full replay of that WAL file, not just having it one less than the master. I have no idea how do explain that. It is easy for streaming replication since the "Latest checkpoint location" should match, which is simple. Also, we need something that can be backpatched. -- Bruce Momjian <br...@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + -- Sent via pgsql-hackers mailing list (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers