TAP test to cover "EndOfLogTLI != replayTLI" case - Mailing list pgsql-hackers

From Amul Sul
Subject TAP test to cover "EndOfLogTLI != replayTLI" case
Date
Msg-id CAAJ_b94Vjt5cXGza_1MkjLQWciNdEemsmiWuQj0d=M7JfjAa1g@mail.gmail.com
Whole thread Raw
Responses Re: TAP test to cover "EndOfLogTLI != replayTLI" case
List 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

pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: row filtering for logical replication
Next
From: Greg Nancarrow
Date:
Subject: Re: Failed transaction statistics to measure the logical replication progress