From: | Nathan Bossart <nathandbossart(at)gmail(dot)com> |
---|---|
To: | Michael Paquier <michael(at)paquier(dot)xyz> |
Cc: | Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: recovery modules |
Date: | 2023-01-31 23:30:13 |
Message-ID: | 20230131233013.GA3146744@nathanxps13 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Tue, Jan 31, 2023 at 08:13:11AM +0900, Michael Paquier wrote:
> On Mon, Jan 30, 2023 at 12:04:22PM -0800, Nathan Bossart wrote:
>> On Mon, Jan 30, 2023 at 11:48:10AM -0800, Andres Freund wrote:
>>> I don't think _PG_archive_module_init() should actually allocate a memory
>>> context and do other similar initializations. Instead it should just return
>>> 'const ArchiveModuleCallbacks*', typically a single line.
>>>
>>> Allocations etc should happen in one of the callbacks. That way we can
>>> actually have multiple instances of a module.
>>
>> I think we'd need to invent a startup callback for archive modules for this
>> to work, but that's easy enough.
>
> If you don't return some (void *) pointing to a private area that
> would be stored by the backend, allocated as part of the loading path,
> I agree that an extra callback is what makes the most sense,
> presumably called around the beginning of PgArchiverMain(). Doing
> this kind of one-time action in the file callback woud be weird..
Okay, here is a new patch set with the aforementioned adjustments and
documentation updates.
--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com
Attachment | Content-Type | Size |
---|---|---|
v2-0001-s-ArchiveContext-ArchiveCallbacks.patch | text/x-diff | 2.8 KB |
v2-0002-move-archive-module-exports-to-dedicated-header.patch | text/x-diff | 6.0 KB |
v2-0003-restructure-archive-modules-API.patch | text/x-diff | 12.5 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Jeff Davis | 2023-01-31 23:33:10 | Re: Rework of collation code, extensibility |
Previous Message | Peter Geoghegan | 2023-01-31 23:19:39 | Re: Show various offset arrays for heap WAL records |