Re: Failure of subscription tests with topminnow

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Ajin Cherian <itsajin(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Failure of subscription tests with topminnow
Date: 2021-08-24 13:11:49
Message-ID: CAA4eK1+Nso_HKs+8049_jy0mfG4fn9=8=VwZLTA_zaLpAN4KnQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 24, 2021 at 6:28 PM Ajin Cherian <itsajin(at)gmail(dot)com> wrote:
>
> On Tue, Aug 24, 2021 at 9:08 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> > What happens when there is neither a new walsender nor an old
> > walsender is present? It means to run the above statement when a new
> > walsender is exited due to error "... slot is active ..." and before a
> > new walsender could start. Also, allow old walsender (due to which the
> > error occurs) to exit before executing the statement.
> >
> I tried this, then the query returns a null instead of 'false' because
> there is no entry for that application_name.
>
> postgres=# select pid != 31876 from pg_stat_replication where
> application_name = 'sub';
> ?column?
> ----------
> (0 rows)
>

But will poll function still poll or exit? Have you tried that?
Because it is not clear from your explanation how in the first
statement it returns a valid value which leads poll to exit and then
in second statement it returns NULL or maybe nothing. Can you share
the log also when you are getting "replication slot "tap_sub" is
active for ..."? If you see in the below log [1], the STATEMENT is
printed twice, I want to see if you also get prints in a similar way
or is it something different? Do you know why it is printed twice?

[1]
2021-08-15 18:44:38.027 CEST [16475:6] tap_sub LOG: received
replication command: START_REPLICATION SLOT "tap_sub" LOGICAL
0/16BEEB0 (proto_version '1', publication_names
'"tap_pub","tap_pub_ins_only"')
2021-08-15 18:44:38.027 CEST [16475:7] tap_sub STATEMENT:
START_REPLICATION SLOT "tap_sub" LOGICAL 0/16BEEB0 (proto_version '1',
publication_names '"tap_pub","tap_pub_ins_only"')
2021-08-15 18:44:38.027 CEST [16475:8] tap_sub ERROR: replication
slot "tap_sub" is active for PID 16336
2021-08-15 18:44:38.027 CEST [16475:9] tap_sub STATEMENT:
START_REPLICATION SLOT "tap_sub" LOGICAL 0/16BEEB0 (proto_version '1',
publication_names '"tap_pub","tap_pub_ins_only"')

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2021-08-24 13:13:20 Re: PoC/WIP: Extended statistics on expressions
Previous Message Amit Kapila 2021-08-24 13:05:01 Re: Skipping logical replication transactions on subscriber side