TAP test to cover "EndOfLogTLI != replayTLI" case

From: Amul Sul <sulamul(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: TAP test to cover "EndOfLogTLI != replayTLI" case
Date: 2021-11-23 06:13:21
Message-ID: CAAJ_b94Vjt5cXGza_1MkjLQWciNdEemsmiWuQj0d=M7JfjAa1g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Attached patch covers a case where TLI in the filename for a
record being read is different from where it belongs to. In other
words, it covers following case noted in StartupXLOG():

/*
* EndOfLogTLI is the TLI in the filename of the XLOG segment containing
* the end-of-log. It could be different from the timeline that EndOfLog
* nominally belongs to, if there was a timeline switch in that segment,
* and we were reading the old WAL from a segment belonging to a higher
* timeline.
*/
EndOfLogTLI = xlogreader->seg.ws_tli;

Test tried to set recovery target just before the end-of-recovery WAL
record. Unfortunately, the test couldn't directly verify EndOfLogTLI
!= replayTLI case, I am not sure how to do that -- any suggestions
will be greatly appreciated. Perhaps, having this test is good to
improve xlog.c test coverage. Also, if you see in other angle test
covers a case where recovery_target_lsn and
recovery_target_inclusive=off which doesn't exist as of now and that
is the reason I have added this test to 003_recovery_targets.pl file.

Thoughts? Suggestions?

--
Regards,
Amul Sul
EDB: http://www.enterprisedb.com

Attachment Content-Type Size
v1-0001-TAP-test-for-EndOfLogTLI.patch application/x-patch 3.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Nancarrow 2021-11-23 06:21:29 Re: Failed transaction statistics to measure the logical replication progress
Previous Message Peter Smith 2021-11-23 06:06:36 Re: row filtering for logical replication