Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15) - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)
Date
Msg-id CAJ7c6TMnKtF4Z3_XC27DSRwSdCi1z92QU9J5wp5p4jLJ4Occ_A@mail.gmail.com
Whole thread Raw
In response to Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)  (Peter Geoghegan <pg@bowt.ie>)
Responses Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)  (Aleksander Alekseev <aleksander@timescale.com>)
List pgsql-hackers
Hi Andres,

> This causes a lot of failures with ubsan

Thanks for reporting this!

I managed to reproduce the issue locally and to fix it. UBSAN is happy
now. PFA v49.

> I bet that this alignment issue can be fixed by using PGAlignedBlock
> instead of a raw char buffer for a page. (I'm guessing, I haven't
> directly checked.)

No, actually the problem was much simpler.

0001 changes SLRU page numbering from 32-bit to 64-bit one. This also
changed the SlruScanDirCbReportPresence() callback:

```
bool
SlruScanDirCbReportPresence(SlruCtl ctl, char *filename, int64 segpage,
                            void *data)
{
    int64        cutoffPage = *(int64 *) data;
```

However TruncateCLOG() and TruncateCommitTs() were not changed
accordingly in v47, they were passing a pointer to int32 as *data.

-- 
Best regards,
Aleksander Alekseev

Attachment

pgsql-hackers by date:

Previous
From: Richard Guo
Date:
Subject: Check lateral references within PHVs for memoize cache keys
Next
From: Alvaro Herrera
Date:
Subject: Re: generic plans and "initial" pruning