Re: [HACKERS] Broken hint bits (freeze) - Mailing list pgsql-hackers
From | Amit Kapila |
---|---|
Subject | Re: [HACKERS] Broken hint bits (freeze) |
Date | |
Msg-id | CAA4eK1+MvyM5BWbXzbFyAyhB7DGXwCYyxb056rv26XV3KWaLNQ@mail.gmail.com Whole thread Raw |
In response to | Re: [HACKERS] Broken hint bits (freeze) (Bruce Momjian <bruce@momjian.us>) |
Responses |
Re: [HACKERS] Broken hint bits (freeze)
|
List | pgsql-hackers |
On Fri, Jun 23, 2017 at 8:18 PM, Bruce Momjian <bruce@momjian.us> wrote: > On Fri, Jun 23, 2017 at 08:10:17AM +0530, Amit Kapila wrote: >> On Wed, Jun 21, 2017 at 10:03 PM, Bruce Momjian <bruce@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.kapila16@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. > If the user has properly shutdown, then that last file should only have checkpoint record, is it safe to proceed with upgrade without actually copying that file? -- With Regards, Amit Kapila. EnterpriseDB: http://www.enterprisedb.com
pgsql-hackers by date: