Re: A failure of standby to follow timeline switch
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: masao.fujii@oss.nttdata.com
Cc: pgsql-hackers@lists.postgresql.org
Date: 2021-01-05T08:26:02Z
Lists: pgsql-hackers
Attachments
At Mon, 4 Jan 2021 19:00:21 +0900, Fujii Masao <masao.fujii@oss.nttdata.com> wrote in > > > On 2021/01/04 12:06, Kyotaro Horiguchi wrote: > > At Sat, 26 Dec 2020 02:15:06 +0900, Fujii Masao > > <masao.fujii@oss.nttdata.com> wrote in > >> > >> On 2020/12/25 12:03, Kyotaro Horiguchi wrote: > > The attached is the fixed version. > > Thanks for updating the patches! > > > In the first patch, the test added to 001_stream_rep.pl involves two > > copied functions related to server-log investigation from > > 019_repslot_limit.pl. > > So you're planning to define them commonly in TestLib.pm or elsewhere? Yeah.. That's correct. Newly added as the first patch. While making that change, I extended the interface of slurp_file to allow reading from arbitrary position. I attached this as a separate patch just for clarifying the changeset. The existing messages for open() and OSHandleOpen() look somewhat strange after patching since they are not really "read" errors, but they're harmless. (It successfully ran also on Windows10) The first hunk below is a fix for a forgotten line-feed. my $fHandle = createFile($filename, "r", "rwd") - or croak "could not open \"$filename\": $^E"; + or croak "could not open \"$filename\": $^E\n"; OsFHandleOpen(my $fh = IO::Handle->new(), $fHandle, 'r') or croak "could not read \"$filename\": $^E\n"; + seek($fh, $from, 0) + or croak "could not seek \"$filename\" to $from: $^E\n"; > +$node_primary_2->init(allows_streaming => 1); > +$node_primary_2->enable_archiving; # needed to make .paritial segment > > Isn't it better to use has_archiving flag in init() instead of doing > enable_archiving, like other tests do? Agreed. Fixed 0002 (formerly 0001). > 0002 looks good to me. Thanks. The attached is the revised patchset. regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
Ensure that a standby is able to follow a primary on a newer timeline.
- 94f52929a0c4 13.2 landed
- fef5b47f6bfc 14.0 landed