Re: BUG #17928: Standby fails to decode WAL on termination of primary

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Alexander Lakhin <exclusion(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Sergei Kornilov <sk(at)zsrv(dot)org>, Noah Misch <noah(at)leadboat(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org, Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>
Subject: Re: BUG #17928: Standby fails to decode WAL on termination of primary
Date: 2023-09-17 20:46:17
Message-ID: CA+hUKGK=o+v3w=XsWu+vGUZNsQK=-moFO8G61GsFjLk47GZJ8A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Sep 16, 2023 at 6:00 PM Alexander Lakhin <exclusion(at)gmail(dot)com> wrote:
> It looks like the construction "@{^CAPTURE}" used in scan_server_header()
> is not supported by Perl 5.24, which is included in Debian stretch:
> https://perldoc.perl.org/variables/@%7B%5ECAPTURE%7D
> I replaced it with
> @match = ($1);
> and that worked for me.

Thanks for catching that! I see that %{^CAPTURE} was added to Perl
5.25.7, but we document Perl 5.14 or later as the requirement
currently, and for REL_12_STABLE it's Perl 5.8.3. That would
certainly have turned a few build farm fossils red.

Your replacement only returns the first captured group. I don't know
Perl, but I think we can just assign the whole array to @match
directly, to maintain the semantics that Michael wanted, like so:

- if ($line =~ /^$regexp/)
+ if (@match = $line =~ /^$regexp/)
{
- # Found match, so store all the results.
- @match = @{^CAPTURE};
last;
}

Better Perl welcome.

Looking into your observation about wal_log_hints...

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David Rowley 2023-09-17 23:36:42 Re: group by true now errors with non-integer constant in GROUP BY
Previous Message Dave Cramer 2023-09-17 11:33:06 Re: the same time value return different values,is it a problem