Re: Add 'worker_type' to pg_stat_subscription

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Maxim Orlov <orlovmg(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add 'worker_type' to pg_stat_subscription
Date: 2023-09-18 21:18:44
Message-ID: CAHut+Pt_P3uPt7Zc3+NtBgbQTWhtVwNOJgkHg2WaVcqec17h4Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Sep 19, 2023 at 1:20 AM Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
>
> On Mon, Sep 18, 2023 at 04:56:46PM +1000, Peter Smith wrote:
> > On Mon, Sep 18, 2023 at 1:43 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> >> One simple idea to reduce confusion could be to use (leader) in the
> >> above two places. Do you see any other place which could be confusing
> >> and what do you suggest to fix it?
> >
> > IIRC we first encountered this problem with the parallel apply workers
> > were introduced -- "leader" was added wherever we needed to
> > distinguish the main apply and the parallel apply worker. Perhaps at
> > that time, we ought to have changed it *everywhere* instead of
> > changing only the ambiguous places. Lately, I've been thinking it
> > would have been easier to have *one* rule and always call the (main)
> > apply worker the "leader apply" worker -- simply because 2 names
> > ("leader apply" and "parallel apply") are easier to explain than 3
> > names.
> >
> > A "leader apply" worker with no "parallel apply" workers is a bit like
> > the "boss" of a company that has no employees -- IMO it's OK to still
> > say that they are the "boss".
>
> From the latest discussion, it sounds like you (Peter and Amit) are leaning
> more towards something like the v7 patch [0]. I'm okay with that. Perhaps
> it'd be worth starting a new thread after this one to make the terminology
> consistent in the docs, error messages, views, etc. Fortunately, we have
> some time to straighten this out for v17.
>

Yes, the v7 patch looked good to me.

> > Regardless, I think changing this in other docs and other code is
> > outside the scope of this simple pg stats patch -- here we can just
> > change the relevant config docs and the stats attribute value to
> > "leader apply" and leave it at that.
> >
> > Changing every other place to consistently say "leader apply" is a
> > bigger task for another thread because we will find lots more places
> > to change. For example, there are messages like: "logical replication
> > apply worker for subscription \"%s\" has started" that perhaps should
> > say "logical replication leader apply worker for subscription \"%s\"
> > has started". Such changes don't belong in this stats patch.
>
> +1
>
> [0] https://postgr.es/m/attachment/150345/v7-0001-Add-worker-type-to-pg_stat_subscription.patch
>

------
Kind Regards,
Peter Smith.
Fujitsu Australia

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-09-18 21:22:32 Re: Inefficiency in parallel pg_restore with many tables
Previous Message Jeff Davis 2023-09-18 20:50:59 Re: CREATE FUNCTION ... SEARCH { DEFAULT | SYSTEM | SESSION }