Re: Unit tests for SLRU - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Unit tests for SLRU
Date
Msg-id Y3QtM2/KfodfcnEj@paquier.xyz
Whole thread Raw
In response to Re: Unit tests for SLRU  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-hackers
On Tue, Nov 15, 2022 at 11:39:20AM +0100, Daniel Gustafsson wrote:
> +    /* write given data to the page */
> +    strncpy(TestSlruCtl->shared->page_buffer[slotno], data, BLCKSZ - 1);
>
> Would it make sense to instead use pg_pwrite to closer match the code being
> tested?

Hmm.  I am not exactly sure what we'd gain with that, as it would
imply that we need to write directly to the file using SlruFileName()
after doing ourselves a OpenTransientFile(), duplicating what
SlruPhysicalWritePage() does to create a fd to feed to a pg_pwrite()?
Or I misunderstood your point.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Slow standby snapshot
Next
From: Jeff Davis
Date:
Subject: Re: allowing for control over SET ROLE