Re: Design of pg_stat_subscription_workers vs pgstats

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Design of pg_stat_subscription_workers vs pgstats
Date: 2022-02-19 17:04:57
Message-ID: CAKFQuwb27zsWLU0gRqEOd_NiozqWPaz72GWagYcaWOamYVTwdA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Feb 19, 2022 at 9:37 AM Andres Freund <andres(at)anarazel(dot)de> wrote:

> IMO the type of information you'd want for apply failures is substantially
>
different enough from worker failures that I don't really see the temptation
> to put them in the same table.
>
>
It's an error message and a transaction LSN in both cases right now, along
with knowledge of whether said transaction only affects a single table
(relid is not null) or not (relid is null). Do you have a concrete idea in
mind that would make this separation need more obvious?

> I also still think that _worker shouldn't be part of any of the naming
> here. It's an implementation detail that we use one worker for one
> tablesync
> etc. It'd make sense for one apply worker to sync multiple small tables,
> and
> it'd make a lot of sense for multiple apply workers to collaborate on
> syncing
> one large relation.
>

Good point. The existing design doesn't actually require the "worker
status" concept I described; so let's not have worker be part of the name.

So basically separate the proposed pg_subscription_error table into two: a
pg_subscription_tablesync_error and pg_subscription_apply_error. The
former having a relid field while the later does not. What fields belong on
each?

How about we have it both ways. Two tables but provide a canonical view
union'ing them that a user can query to see whether any errors are
presently affecting their system?

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yugo NAGATA 2022-02-19 18:01:27 Re: use rotate macro in more places
Previous Message Andres Freund 2022-02-19 17:03:14 Re: Reducing power consumption on idle servers