Re: pg_walinspect - a new extension to get raw WAL data and WAL stats

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Greg Stark <stark(at)mit(dot)edu>, Jeremy Schneider <schneider(at)ardentperf(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>, marvin_liang(at)qq(dot)com, actyzhang(at)outlook(dot)com
Subject: Re: pg_walinspect - a new extension to get raw WAL data and WAL stats
Date: 2022-02-16 03:24:36
Message-ID: CALj2ACXPncnUSS-k0g-9Amo5_jDn-pyG9oT4d+roPjXAkTZyFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 16, 2022 at 1:57 AM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Tue, Feb 15, 2022 at 2:31 PM Bharath Rupireddy
> <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> > > +/*
> > > + * Verify the authenticity of the given raw WAL record.
> > > + */
> > > +Datum
> > > +pg_verify_raw_wal_record(PG_FUNCTION_ARGS)
> > > +{
> > >
> > >
> > > Do we really need this function? I see that whenever the record is
> > > read, we verify it. So could there be a scenario where any of these
> > > functions would return an invalid WAL record?
> >
> > Yes, this function can be useful. Imagine a case where raw WAL records
> > are fetched from one server using pg_get_wal_record_info and sent over
> > the network to another server (for fixing some of the corrupted data
> > pages or for whatever reasons), using pg_verify_raw_wal_record one can
> > verify authenticity.
>
> As I also said before, and so did Greg, I think giving the user a way
> to supply WAL records that we will then try to decode is never going
> to be OK. It's going to be a recipe for security bugs and crash bugs,
> and there's no compelling use case for it that I can see. I support
> this patch set only to the extent that it decodes locally generated
> WAL read directly from the WAL stream.

Agreed, I will remove pg_verify_raw_wal_record function in the next
version of the patch set. Thanks.

Regards,
Bharath Rupireddy.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Sharma 2022-02-16 03:34:38 Re: pg_walinspect - a new extension to get raw WAL data and WAL stats
Previous Message osumi.takamichi@fujitsu.com 2022-02-16 03:15:20 RE: logical replication empty transactions