Subject: Re: Minimal logical decoding on standbys

From: "Drouvot, Bertrand" <[email-masked]>
Date: Fri, 25 Feb 2022 10:34:58 +0100

Hi,

On 10/28/21 11:07 PM, Andres Freund wrote:
> Hi,
>
> On 2021-10-28 16:24:22 -0400, Robert Haas wrote:
>> On Wed, Oct 27, 2021 at 2:56 AM Drouvot, Bertrand <[email-masked]> wrote:
>>> So you have in mind to check for XLogLogicalInfoActive() first, and if true, then open the relation and call
>>> RelationIsAccessibleInLogicalDecoding()?
>> I think 0001 is utterly unacceptable. We cannot add calls to
>> table_open() in low-level functions like this. Suppose for example
>> that _bt_getbuf() calls _bt_log_reuse_page() which with 0001 applied
>> would call get_rel_logical_catalog(). _bt_getbuf() will have acquired
>> a buffer lock on the page. The idea that it's safe to call
>> table_open() while holding a buffer lock cannot be taken seriously.
> Yes - that's pretty clearly a deadlock hazard. It shouldn't too hard to fix, I
> think. Possibly a bit more verbose than nice, but...
>
> Alternatively we could propagate the information whether a relcache entry is
> for a catalog from the table to the index. Then we'd not need to change the
> btree code to pass the table down.

+1 for the idea of propagating to the index. If that sounds good to you 
too, I can try to have a look at it.

Thanks Robert and Andres for the feedbacks you have done on the various 
sub-patches.

I've now in mind to work sub patch by sub patch (starting with 0001 
then) and move to the next one once we agree that the current one is 
"ready".

I think that could help us to get this new feature moving forward more 
"easily", what do you think?

Thanks

Bertrand

---

From: "Drouvot, Bertrand" <[email-masked]>
Date: Thu, 30 Jun 2022 10:49:29 +0200

Hi,

On 2/25/22 10:34 AM, Drouvot, Bertrand wrote:
> +1 for the idea of propagating to the index. If that sounds good to 
> you too, I can try to have a look at it.
>
> Thanks Robert and Andres for the feedbacks you have done on the 
> various sub-patches.
>
I'm going to re-create a CF entry for it, as:

- It seems there is a clear interest for the feature (given the time 
already spend on it and the number of people that worked on)

- I've in mind to resume working on it

- It would give more visibility in case others want to jump in

Hope that makes sense,

Thanks,

Bertrand

---

From: Ibrar Ahmed <[email-masked]>
Date: Sat, 2 Jul 2022 01:03:22 +0500

On Thu, Jun 30, 2022 at 1:49 PM Drouvot, Bertrand <[email-masked]>
wrote:

> I have already done some research on that, I can definitely look at it.

-- 
Ibrar Ahmed

---

From: "Drouvot, Bertrand" <[email-masked]>
Date: Mon, 4 Jul 2022 15:12:05 +0200

Hi,

On 7/1/22 10:03 PM, Ibrar Ahmed wrote:
>
> On Thu, Jun 30, 2022 at 1:49 PM Drouvot, Bertrand 
> <[email-masked]> wrote:
>
Thanks!

This feature proposal is currently made of 5 sub-patches:

0001: Add info in WAL records in preparation for logical slot conflict 
handling
0002: Handle logical slot conflicts on standby
0003: Allow logical decoding on standby.
0004: New TAP test for logical decoding on standby
0005: Doc changes describing details about logical decoding

I suggest that we focus on one sub-patch at a time.

I'll start with 0001 and come back with a rebase addressing Andres and 
Robert's previous comments.

Sounds good to you?

Thanks

-- 
Bertrand Drouvot
Amazon Web Services:https://aws.amazon.com

---

From: Ibrar Ahmed <[email-masked]>
Date: Mon, 4 Jul 2022 18:17:26 +0500

On Mon, Jul 4, 2022 at 6:12 PM Drouvot, Bertrand <[email-masked]>
wrote:

> Amazon Web Services: https://aws.amazon.com
>
> That's great I am looking at "0002: Handle logical slot conflicts on
standby".

-- 
Ibrar Ahmed