Re: pg_walfile_name_offset can return inconsistent values

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Jehan-Guillaume de Rorthais <jgdr(at)dalibo(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: pg_walfile_name_offset can return inconsistent values
Date: 2023-11-13 19:12:12
Message-ID: ZVJ1DA2RCNx8POJR@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 13, 2023 at 09:49:53AM -0800, Andres Freund wrote:
> Hi,
>
> On 2023-11-13 12:14:57 -0500, Bruce Momjian wrote:
> > +SELECT *
> > +FROM (values ('0/16ffffff'), ('0/17000000'), ('0/17000001')) as t(lsn),
> > + LATERAL pg_walfile_name_offset(lsn::pg_lsn),
> > + LATERAL pg_walfile_name(lsn::pg_lsn);
> > + lsn | file_name | file_offset | pg_walfile_name
> > +------------+--------------------------+-------------+--------------------------
> > + 0/16ffffff | 000000010000000000000016 | 16777215 | 000000010000000000000016
> > + 0/17000000 | 000000010000000000000017 | 0 | 000000010000000000000017
> > + 0/17000001 | 000000010000000000000017 | 1 | 000000010000000000000017
> > +(3 rows)
>
> These would break when testing with a different segment size. Today that's not
> the case...

Okay, test removed in the updated patch.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Only you can decide what is important to you.

Attachment Content-Type Size
offset1.diff text/x-diff 4.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Atkinson 2023-11-13 19:12:31 Re: [PATCH] pgbench log file headers
Previous Message Bruce Momjian 2023-11-13 19:05:23 Re: Question about non-blocking mode in libpq