Re: A few patches to clarify snapshot management, part 2

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: A few patches to clarify snapshot management, part 2
Date: 2025-12-19 11:40:59
Message-ID: 8aa255b2-e061-4c09-a458-5ac755104695@iki.fi
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 19/12/2025 07:15, Chao Li wrote:
>> On Dec 19, 2025, at 07:30, Heikki Linnakangas <hlinnaka(at)iki(dot)fi> wrote:
>> Patch 0001: Use a proper type for RestoreTransactionSnapshot's PGPROC arg
>>
>> Minor cleanup, independent of the rest of the patches
>
> Looks like this cleanup should have done earlier. The old comments says that only reason to use void * is to avoid include a header file. But in snapmgr.h, there already has a usage of “struct HTAB” from 12 years ago.
>
> Maybe we can also do:
> ```
> typedef struct PGPROC PGPROC;
> extern void RestoreTransactionSnapshot(MVCCSnapshot snapshot, PGPROC *source_pgproc);
> ```
>
> So the function declaration looks neater. snapmgr.h line 101 has done in this way. If not pretty much burden, we can update HTAB as well.

Yeah, we're not very consistent about that. I followed the example of
HTAB and went with "struct PGPROC" for now.

> I believe 0001 is an independent self-contained commit that can be pushed first.

Pushed 0001, thanks for the review!

- Heikki

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2025-12-19 11:51:09 Re: A few patches to clarify snapshot management, part 2
Previous Message vignesh C 2025-12-19 11:35:27 Re: Logical Replication of sequences