Re: [16+] subscription can end up in inconsistent state

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: [16+] subscription can end up in inconsistent state
Date: 2023-09-19 14:03:12
Message-ID: CA+Tgmoa2fp3649-eEiiqQnARR3X1tk1a2v0MJh8EF3Ln8n77qg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, Sep 11, 2023 at 3:00 PM Jeff Davis <pgsql(at)j-davis(dot)com> wrote:
> On Mon, 2023-09-11 at 08:59 +0530, Amit Kapila wrote:
> > Can we think of calling walrcv_check_conninfo() when the following
> > check is true (MySubscription->passwordrequired &&
> > !superuser_arg(MySubscription->owner))? IIUC this has to be done for
> > both apply_worker and tablesync_worker.
>
> To me, it would make sense to just have walrcv_connect() do both checks
> (a) and (b) -- rather than only check (b) -- when must_use_password is
> true. Separating these checks (which are really two parts of the same
> check) led to this problem in the first place.

Sorry for the slow response. I agree with this, and I also think that
keeping the existing checks makes sense.

> Another thought: we may also need to invalidate the subscription worker
> in cases where a user loses their superuser status.

I am not sure whether there's any problem here. I don't think it's
important that the worker realizes that it's lost superuser
instantaneously. But it should probably realize it, say, at the next
transaction boundary.

--
Robert Haas
EDB: http://www.enterprisedb.com

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2023-09-19 15:24:25 Re: a plpgsql bug
Previous Message Thomas Schweikle 2023-09-19 13:58:23 Stackbuilder fails to download application list