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: Peter Smith <smithpb2250@gmail.com>, Robert Haas <robertmhaas@gmail.com>, Amit Kapila <amit.kapila16@gmail.com>, pgsql-bugs@postgresql.org
Date: 2024-01-17T10:01:26Z
Lists: pgsql-bugs

Attachments

On Sat, 13 Jan 2024 at 03:25, Jeff Davis <pgsql@j-davis.com> wrote:
>
> On Mon, 2023-11-27 at 10:26 +0530, vignesh C wrote:
> > The patch was not applying on HEAD because of recent commits, the
> > attached v6 version patch is rebased on top of HEAD.
>
> Thank you, committed with minor modifications.
>
> I decided to do:
>
>    libpqrcv_check_conninfo(conninfo, must_use_password);
>
> rather than:
>
>    if (must_use_password)
>       libpqrcv_check_conninfo(conninfo, true);
>
> because if there's some parsing error then we wouldn't like it to be
> conditional on must_use_password. Of course, there should not be any
> parsing error because it was already validated at DDL time, but in case
> there's another way to get into an inconsistent state, we might as well
> re-validate here.

There was a buildfarm failure at [1], I was able to reproduce it in my
environment. The changes suggested by Tom Lane at [2] fixes the
problem. Apart from that pg_hba.conf should have authentication
configuration for the host which does not use unix domain sockets. The
attached patch has the changes for the same.

[1] - https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=drongo&dt=2024-01-16%2013%3A33%3A08
[2] - https://www.postgresql.org/message-id/1641594.1705374393%40sss.pgh.pa.us

Regards,
Vignesh

Commits

  1. Fix buildfarm error from commit 5c31669058.

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