Re: [HACKERS] Broken hint bits (freeze) - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: [HACKERS] Broken hint bits (freeze)
Date
Msg-id CAA4eK1JgvFAU8XTNBxPhsBxLeBU3x63-6=pOX+9NpQYFpHqUrQ@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)  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
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.



-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: [HACKERS] Setting pd_lower in GIN metapage
Next
From: Brendan Jurd
Date:
Subject: Re: [HACKERS] psql: Activate pager only for height, not width