Re: START_REPLICATION silently truncates an overlong LSN component

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: Jan Nidzwetzki <jan(at)planetscale(dot)com>, Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>, ♂π≌26218 <1991230470(at)qq(dot)com>, pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: START_REPLICATION silently truncates an overlong LSN component
Date: 2026-10-21 06:36:07
Message-ID: CAHGQGwFJs1Kb3kqpatk-=d2M5g=7yar+dyrDiqNYYVFf-F3-rQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Oct 20, 2026 at 8:29 PM Hayato Kuroda (Fujitsu)
<kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
> OK, PSA 0004.

Thanks!

+ if (fscanf(lfp, "INCREMENTAL FROM LSN: %17s\n", lsn) > 0 ||
+ !pg_parse_lsn(lsn, &istartpoint))

When fscanf() succeeds, pg_parse_lsn() is skipped. If the line is absent,
it parses the previous CHECKPOINT LOCATION value instead. Isn't this
problematic?

Since we don't use this LSN, how about removing the pg_parse_lsn() check
and istartpoint and simply rejecting the backup if fscanf() returns > 0?

> We can reduce the magic number from 0004 if we export
> MAXPG_LSNLEN

+1

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2026-10-21 06:42:58 Re: pg_stat_statements replaces SQL/JSON ON EMPTY / ON ERROR keywords with parameters
Previous Message Michael Paquier 2026-10-21 05:56:41 Re: BUG #19763: ManualBug2 NULL pointer dereference in make_build_data via examine_expression bypass of lookup_var_a