Re: [16] ALTER SUBSCRIPTION ... SET (run_as_owner = ...) is a no-op

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
Cc: Jeff Davis <pgsql(at)j-davis(dot)com>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: [16] ALTER SUBSCRIPTION ... SET (run_as_owner = ...) is a no-op
Date: 2023-09-13 10:42:45
Message-ID: CAA4eK1+dBu_daekVjTMg_AyZn7kbH9tOA8Jve5sRnhSD-T6_iw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Sep 12, 2023 at 7:10 AM Zhijie Hou (Fujitsu)
<houzj(dot)fnst(at)fujitsu(dot)com> wrote:
>
> On Monday, September 11, 2023 7:49 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> >
> > On Mon, Sep 11, 2023 at 10:46 AM Zhijie Hou (Fujitsu) <houzj(dot)fnst(at)fujitsu(dot)com>
> > wrote:
> > >
> > > On Sunday, September 10, 2023 4:43 AM Jeff Davis <pgsql(at)j-davis(dot)com>
> > wrote:
> > > >
> > > >
> > > > Repro:
> > > > ALTER SUBSCRIPTION s1 SET (run_as_owner = true);
> > > > SELECT subrunasowner FROM pg_subscription WHERE subname='s1';
> > > > subrunasowner
> > > > ---------------
> > > > f
> > > > (1 row)
> > > >
> > >
> > > Thanks for reporting. I can also reproduce the issue. I think it's
> > > because we didn't reflect the option change on catalog. Here is a small patch
> > 0001 to fix it.
> > >
> >
> > Your fix looks good to me.
>
> Thanks for reviewing.
>
> >
> > > > It also looks like a change to that field may not cause the
> > > > subscription worker to restart. It would be good to add a test for that case.
> > >
> > > Currently, the changes on run_as_owner won't cause the worker to
> > > restart because we don't need to rebuild the connection in this case.
> > > The option change will be caught by apply worker in next loop and the
> > > later changes will be applied using the new option. the 0002 patch
> > > adds a test to verfiy it, just to show how it behaves.
> > >
> >
> > Is there a reason to not include 0002 in the commit?
>
> No, I think it's fine to include 0002.
>

Pushed by slightly adjusting the comments in the test case.

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2023-09-13 13:24:42 Re: Memory leak on subquery as scalar operand
Previous Message 姜梦洋 2023-09-13 08:11:26 Re: the same time value return different values,is it a problem