public inbox for [email protected]
help / color / mirror / Atom feedFrom: [email protected] <[email protected]>
To: [email protected] <[email protected]>
Cc: Kyotaro Horiguchi <[email protected]>
Cc: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>
Cc: 'Greg Nancarrow' <[email protected]>
Subject: RE: Failed transaction statistics to measure the logical replication progress
Date: Wed, 22 Dec 2021 12:37:35 +0000
Message-ID: <OS3PR01MB6275734F2CCB71ACFE9074509E7D9@OS3PR01MB6275.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <TYCPR01MB8373176545F7AE2CCDA23B81ED7D9@TYCPR01MB8373.jpnprd01.prod.outlook.com>
References: <CALDaNm0Wg8XwfqUVnBSSahOtNxGDLNOW1_tc4ikZK=tGfqje-A@mail.gmail.com>
<TYCPR01MB8373A9B6508E44E547A98EF5ED779@TYCPR01MB8373.jpnprd01.prod.outlook.com>
<TYCPR01MB83734A7A0596AC7ADB0DCB51ED779@TYCPR01MB8373.jpnprd01.prod.outlook.com>
<[email protected]>
<TYCPR01MB83736371B66F90C71365ED11ED7B9@TYCPR01MB8373.jpnprd01.prod.outlook.com>
<CAJcOf-dmfinJDr=nOmjX1qNiU_mvW5tG3GyVwsQzRnUBb2ky0A@mail.gmail.com>
<TYCPR01MB8373176545F7AE2CCDA23B81ED7D9@TYCPR01MB8373.jpnprd01.prod.outlook.com>
On Mon, Dec 22, 2021 at 6:14 PM [email protected] <[email protected]> wrote:
>
> Attached the new patch v19.
>
I have a question on the v19-0002 patch:
When I tested for this patch, I found pg_stat_subscription_workers has some unexpected data.
For example:
[Publisher]
create table replica_test1(a int, b text); create publication pub1 for table replica_test1;
create table replica_test2(a int, b text); create publication pub2 for table replica_test2;
[Subscriber]
create table replica_test1(a int, b text); create subscription sub1 CONNECTION 'dbname=postgres' publication pub1;
create table replica_test2(a int, b text); create subscription sub2 CONNECTION 'dbname=postgres' publication pub2;
[Publisher]
insert into replica_test1 values(1,'1');
[Subscriber]
select * from pg_stat_subscription_workers;
-[ RECORD 1 ]------+------
Subid | 16389
subname | sub1
subrelid |
commit_count | 1
...
-[ RECORD 2 ]------+------
subid | 16395
subname | sub2
subrelid |
commit_count | 1
...
I originally expected only one record for "sub1".
I think the reason is apply_handle_commit() always invoke pgstat_report_subworker_xact_end().
But when we insert data to replica_test1 in publish side:
[In the publish]
pub1's walsender1 will send three messages((LOGICAL_REP_MSG_BEGIN, LOGICAL_REP_MSG_INSERT and LOGICAL_REP_MSG_COMMIT))
to sub1's apply worker1.
pub2's walsender2 will also send two messages(LOGICAL_REP_MSG_BEGIN and LOGICAL_REP_MSG_COMMIT)
to sub2's apply worker2. Because inserted table is not published by pub2.
[In the subscription]
sub1's apply worker1 receive LOGICAL_REP_MSG_COMMIT,
so invoke pgstat_report_subworker_xact_end to increase commit_count of sub1's stats.
sub2's apply worker2 receive LOGICAL_REP_MSG_COMMIT,
it will do the same action to increase commit_count of sub2's stats.
Do we expect these commit counts which come from empty transactions ?
Regards,
Wang wei
view thread (113+ messages) latest in thread
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 using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: RE: Failed transaction statistics to measure the logical replication progress
In-Reply-To: <OS3PR01MB6275734F2CCB71ACFE9074509E7D9@OS3PR01MB6275.jpnprd01.prod.outlook.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox