Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mwhUY-000463-Fv for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Dec 2021 09:19:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mwhUV-0000RS-Q8 for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Dec 2021 09:19:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mwhUV-0000RI-Dr for pgsql-hackers@lists.postgresql.org; Mon, 13 Dec 2021 09:19:27 +0000 Received: from mail-yb1-xb2f.google.com ([2607:f8b0:4864:20::b2f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mwhUO-0001yE-KP for pgsql-hackers@lists.postgresql.org; Mon, 13 Dec 2021 09:19:26 +0000 Received: by mail-yb1-xb2f.google.com with SMTP id f186so36722916ybg.2 for ; Mon, 13 Dec 2021 01:19:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8Pru1NpZI87zhMqUBfe2/EyaJoL8fpbBxZ/UHTlVloo=; b=Cdqam6sYjacI1mZCoDQhWZplvtvhBolEZRduXpqHdfss5NwuV4TDovLMRK2xlY9pFV /ihhjqI2GU3F6pMWzqbZdjHlmLphkjwxbJvkyT/hnjW6DPUqOGWI8AkbApudPmhc9bsh hfZC97CL/gpoVGFMl7OxUmLOcmztlGYAtnNk9KTH8w/+QFgsbLj9yq1xplb+pC39lHiI 7Y6hOPZNTJ9JkljZr7pg2JSFiGAJnq9riHGSzbOS79aRDUAtOU+6oym0BrellHW0Q36f Ym+FfVyPRMZTgW0355lawUWPewE1gKLoEFiD23r7E9iqEY1atxpEA3mVlnzJyJDcGvTY M2PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8Pru1NpZI87zhMqUBfe2/EyaJoL8fpbBxZ/UHTlVloo=; b=q5Oc6HSRsbUxWmdIWBo4jnCsdpV5mfHa9ghqu9lHUC1dP7a7Ud9IdeUHu35NKMA8P6 pzqg2sKhLgLF9GAOtITH9kUkb/qpMwJaVmYn7FlZoFSfUVrDSdlZpxxg2OSKoeII1PIB 4CjZBsNSdcIydxjR2v26OXVPlWcHqdr/nHCaL02LCTf3UocmKp5HHbI3ofX9leMzmdr8 UHFvxa/KDLDankd05cGfJ5ZZl6Z7Qgg0Es2vrItE2yQ/vmv1IyJuHaWsPClGuiKiyLCe 08zB47zJzPXKbsT5UtNqpz5nAFIq92tQXd60W0Dkx8L60lVt6yWrrOdXsJjoHFeRisVx TbJA== X-Gm-Message-State: AOAM530j22gvnLs22oulmdOmbBpS5fJagvuqj5vnxFtnNH5ER1XxRnWG 1hXcnAaAonAp/mHenQx9fSWsrzFBcjLPLCPgflE= X-Google-Smtp-Source: ABdhPJwtiLER7Qh6MnZmyRz+esJrJIEvXQzob1iwZ2eipHm0YWyyaiG5i5imxNJ7d2abkXMMENQrbXVoLIpUphgJELU= X-Received: by 2002:a25:7209:: with SMTP id n9mr32159744ybc.692.1639387159551; Mon, 13 Dec 2021 01:19:19 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Mon, 13 Dec 2021 14:49:08 +0530 Message-ID: Subject: Re: Failed transaction statistics to measure the logical replication progress To: "osumi.takamichi@fujitsu.com" Cc: vignesh C , Masahiko Sawada , Greg Nancarrow , "houzj.fnst@fujitsu.com" , "pgsql-hackers@lists.postgresql.org" Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Dec 7, 2021 at 3:12 PM osumi.takamichi@fujitsu.com wrote: > Few questions and comments: ======================== 1. The pg_stat_subscription_workers view will contain one row per subscription worker on which errors have occurred, for workers applying logical replication changes and workers handling the initial data - copy of the subscribed tables. The statistics entry is removed when the - corresponding subscription is dropped. + copy of the subscribed tables. Also, the row corresponding to the apply + worker shows all transaction statistics of both types of workers on the + subscription. The statistics entry is removed when the corresponding + subscription is dropped. Why did you choose to show stats for both types of workers in one row? 2. + PGSTAT_MTYPE_SUBWORKERXACTEND, } StatMsgType; I don't think we comma with the last message type. 3. + Oid m_subrelid; + + /* necessary to determine column to increment */ + LogicalRepMsgType m_command; + +} PgStat_MsgSubWorkerXactEnd; Is m_subrelid used in this patch? If not, why did you keep it? I think if you choose to show separate stats for table sync and apply worker then probably it will be used. 4. /* + * Cumulative transaction statistics of subscription worker + */ + PgStat_Counter commit_count; + PgStat_Counter error_count; + PgStat_Counter abort_count; + I think it is better to keep the order of columns as commit_count, abort_count, error_count in the entire patch. -- With Regards, Amit Kapila.