Re: Seek for helper documents to implement WAL with an FDW

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Komal Habura <komalhabura2(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Seek for helper documents to implement WAL with an FDW
Date: 2023-02-21 09:46:39
Message-ID: CALj2ACXzRto-m3EscLi5jHbrY7_dDPcJ6qfQZ3kReiaUwM8k=A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 21, 2023 at 3:01 PM Komal Habura <komalhabura2(at)gmail(dot)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 stream replication. 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nazir Bilal Yavuz 2023-02-21 10:27:25 Re: meson logs environment
Previous Message Alvaro Herrera 2023-02-21 09:34:11 Re: Incorrect command tag row count for MERGE with a cross-partition update