Re: Seek for helper documents to implement WAL with an FDW - Mailing list pgsql-hackers

From Bharath Rupireddy
Subject Re: Seek for helper documents to implement WAL with an FDW
Date
Msg-id CALj2ACXzRto-m3EscLi5jHbrY7_dDPcJ6qfQZ3kReiaUwM8k=A@mail.gmail.com
Whole thread Raw
In response to Seek for helper documents to implement WAL with an FDW  (Komal Habura <komalhabura2@gmail.com>)
List pgsql-hackers
On Tue, Feb 21, 2023 at 3:01 PM Komal Habura <komalhabura2@gmail.com> wrote:
>
> Hi all,
>         I have written an FDW, which is similar to the file_fdw. I need the support of WAL to perform logical and
streamreplication. I have knowledge about custom WAL but do not have clarity about implementing WAL(writing, redo,
desc,identify, etc..) and cases where WAL can be applied. 
>
> kindly share some documents, and links regarding WAL implementation.
>
> Reference of Custom WAL: - https://www.postgresql.org/docs/current/custom-rmgr.html

You can look at a sample extension called test_custom_rmgrs that
implements custom WAL rmgr -

https://git.postgresql.org/gitweb/?p=postgresql.git;a=tree;f=src/test/modules/test_custom_rmgrs;h=2144037578b01e56cbc8bf80af4fbdaa94c07c17;hb=HEAD.
Basically, custom WAL rmgrs allow one to write WAL records of their
own choice and define what to do when the server is in recovery i.e.
replaying those WAL records or when the server is decoding (for
logical replication) those WAL records.

Coming to whether you need to write WAL at all in your FDW, it depends
on what the FDW does.

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Incorrect command tag row count for MERGE with a cross-partition update
Next
From: Nazir Bilal Yavuz
Date:
Subject: Re: meson logs environment