Re: Synchronizing slots from primary to standby

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>, Ajin Cherian <itsajin(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: Synchronizing slots from primary to standby
Date: 2024-02-01 11:59:15
Message-ID: CAJpy0uCsBOCw0Mewcfm7p6fWdkr1dAyhxzM1ednhP1AvRuC53g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 1, 2024 at 2:35 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> Agreed, and I am fine with merging 0001, 0002, and 0004 as suggested
> by you though I have a few minor comments on 0002 and 0004. I was
> thinking about what will be a logical way to split the slot sync
> worker patch (combined result of 0001, 0002, and 0004), and one idea
> occurred to me is that we can have the first patch as
> synchronize_solts() API and the functionality required to implement
> that API then the second patch would be a slot sync worker which uses
> that API to synchronize slots and does all the required validations.
> Any thoughts?

If we shift 'synchronize_slots()' to the first patch but there is no
caller of it, we may have a compiler warning for the same. The only
way it can be done is if we temporarily add SQL function on standby
which uses 'synchronize_slots()'. This SQL function can then be
removed in later patches where we actually have a caller for
'synchronize_slots'.

For the time being, I have merged 1,2, and some parts of 4 into a
single patch and separated out libpqrc related changes to the first
patch.

Attached v75 patch-set. Changes are:

1) Re-arranged the patches:
1.1) 'libpqrc' related changes (from v74-001 and v74-004) are
separated out in v75-001 as those are independent changes.
1.2) 'Add logical slot sync capability', 'Slot sync worker as special
process' and 'App-name changes' are now merged to single patch which
makes v75-002.
1.3) 'Wait for physical Standby confirmation' and 'Failover Validation
Document' patches are maintained as is (v75-003 and v75-004 now).

2) Addressed comments by Swada-San, Peter and Amit given in [1], [2],
[3] and [4]

[1]: https://www.postgresql.org/message-id/CAD21AoDUfnnxP%2By2cg%3DLhP-bQXqFE1z4US-no%3Du30J7X%3D4Z6Aw%40mail.gmail.com
[2]: https://www.postgresql.org/message-id/CAD21AoAv6FwZ6UPNTj6%3D7A%2B3O2m4utzfL8ZGS6X1EGexikG66A%40mail.gmail.com
[3]: https://www.postgresql.org/message-id/CAHut%2BPuDUT7X7ieB9uQE%3DCLznaVVcQDO2GexkHe1Xfw%3DSWnkPA%40mail.gmail.com
[4]: https://www.postgresql.org/message-id/CAA4eK1K7hLU2ZT1VX2k3e21c%3DkOZySZqfVDJsfE9vAS2AZ0mig%40mail.gmail.com

thanks
Shveta

Attachment Content-Type Size
v75-0003-Allow-logical-walsenders-to-wait-for-the-physica.patch application/octet-stream 40.2 KB
v75-0001-libpqrcv-changes-to-support-slot-synchronization.patch application/octet-stream 11.7 KB
v75-0004-Document-the-steps-to-check-if-the-standby-is-re.patch application/octet-stream 6.6 KB
v75-0002-Add-logical-slot-sync-capability-to-the-physical.patch application/octet-stream 100.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2024-02-01 12:07:46 Re: Synchronizing slots from primary to standby
Previous Message Amit Kapila 2024-02-01 11:23:20 Re: Synchronizing slots from primary to standby