Re: Use read streams in pg_visibility

From: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Use read streams in pg_visibility
Date: 2024-09-02 12:20:12
Message-ID: CAN55FZ3Xh7MjpCnM9uqr4_FZurvF_Uh1a2cG5tgtm+3kbW81tQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Sat, 31 Aug 2024 at 02:51, Noah Misch <noah(at)leadboat(dot)com> wrote:
>
> To read blocks 10 and 11, I would expect to initialize the struct with one of:
>
> { .first=10, .nblocks=2 }
> { .first=10, .last_inclusive=11 }
> { .first=10, .last_exclusive=12 }
>
> With the patch's API, I would need {.first=10,.nblocks=12}. The struct field
> named "nblocks" behaves like a last_block_exclusive. Please either make the
> behavior an "nblocks" behavior or change the field name to replace the term
> "nblocks" with something matching the behavior. (I used longer field names in
> my examples here, to disambiguate those examples. It's okay if the final
> field names aren't those, as long as the field names and the behavior align.)

I decided to use 'current_blocknum' and 'last_exclusive'. I think
these are easier to understand and use.

> > Thanks for the information, I will check these. What I still do not
> > understand is how to make sure that only the second block is processed
> > and the first one is skipped. pg_check_visible() and pg_check_frozen()
> > returns TIDs that cause corruption in the visibility map, there is no
> > information about block numbers.
>
> I see what you're saying. collect_corrupt_items() needs a corrupt table to
> report anything; all corruption-free tables get the same output. Testing this
> would need extra C code or techniques like corrupt_page_checksum() to create
> the corrupt state. That wouldn't be a bad thing to have, but it's big enough
> that I'll consider it out of scope for $SUBJECT. With the callback change
> above, I'll be ready to push all this.

Thanks, updated patches are attached.

--
Regards,
Nazir Bilal Yavuz
Microsoft

Attachment Content-Type Size
v4-0001-Add-general-use-struct-and-callback-to-read-strea.patch application/x-patch 3.1 KB
v4-0002-pg_prewarm-Use-generic-use-read-stream-struct-and.patch application/x-patch 1.9 KB
v4-0003-RelationCopyStorageUsingBuffer-Use-generic-use-re.patch application/x-patch 2.5 KB
v4-0004-Use-read-stream-in-pg_visibility-in-collect_visib.patch application/x-patch 2.4 KB
v4-0005-Use-read-stream-in-pg_visibility-in-collect_corru.patch application/x-patch 5.3 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2024-09-02 12:26:54 Re: Cutting support for OpenSSL 1.0.1 and 1.0.2 in 17~?
Previous Message Daniel Gustafsson 2024-09-02 11:38:06 Re: Jargon and acronyms on this mailing list