pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Create subscription stats entry at CREATE SUBSCRIPTION time
Date: Fri, 07 Oct 2022 00:23:17 +0000
Message-ID: <E1ogb93-001ESo-0P@gemulon.postgresql.org> (raw)

Create subscription stats entry at CREATE SUBSCRIPTION time

Previously, the subscription stats entry was created when the first
stats, i.e., an error on apply worker or tablesync worker,  were
reported. Therefore, the stats_reset field was not updated by
pg_stat_reset_subscription_stats() if the stats entry was not
populated yet, which was different behavior than other statistics.

This change creates the subscription stats entry and initializes it at
CREATE SUBSCRIPTION time.

Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Author: Masahiko Sawada <sawada.mshk@gmail.com>
Discussion: https://postgr.es/m/CAAKRu_Zqd-e5imT_3-ZiQv1cfsWuy16OJTiUaCvqpq4V7GVdSg@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/e0b0142959066f3a9de1c6867f4ec8d41d104f33

Modified Files
--------------
src/backend/utils/activity/pgstat_subscription.c |  8 ++++--
src/test/regress/expected/subscription.out       | 34 ++++++++++++++++++++++++
src/test/regress/sql/subscription.sql            | 11 ++++++++
3 files changed, 51 insertions(+), 2 deletions(-)



Message-ID: <E1ogb93-001ESo-0P@gemulon.postgresql.org>
Permalink:  ../E1ogb93-001ESo-0P@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ogb93-001ESo-0P@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: Create subscription stats entry at CREATE SUBSCRIPTION time
  In-Reply-To: <E1ogb93-001ESo-0P@gemulon.postgresql.org>
  References: <E1ogb93-001ESo-0P@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox