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

vignesh C <vignesh21@gmail.com>

From: vignesh C <vignesh21@gmail.com>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, pgsql-bugs@postgresql.org, Robert Haas <robertmhaas@gmail.com>
Date: 2023-09-21T19:47:50Z
Lists: pgsql-bugs

Attachments

On Tue, 12 Sept 2023 at 01:42, Jeff Davis <pgsql@j-davis.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.

Modified it to make the check in walrcv_connect.

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

Added invalidation of the subscription worker.

Attached patch has the changes for the same.

Regards,
Vignesh

Commits

  1. Fix buildfarm error from commit 5c31669058.

  2. Re-validate connection string in libpqrcv_connect().