Re: logical replication and statistics

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: logical replication and statistics
Date: 2017-09-25 16:35:19
Message-ID: CAFj8pRB=N01=5rhrSuBAaZ=sxSsxhvJdDOYM+YZ8Wg_ZqLK1HA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2017-09-25 18:30 GMT+02:00 Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>:

> On 25/09/17 13:33, Pavel Stehule wrote:
> >
> >
> > 2017-09-25 13:12 GMT+02:00 Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com
> > <mailto:sawada(dot)mshk(at)gmail(dot)com>>:
> >
> > On Mon, Sep 25, 2017 at 12:58 AM, Pavel Stehule
> > <pavel(dot)stehule(at)gmail(dot)com <mailto:pavel(dot)stehule(at)gmail(dot)com>> wrote:
> > > Hi
> > >
> > > I did trivial example of logical replication (one table, one
> publication,
> > > one subscription)
> > >
> > > I am little bit surprised so after some work - the replication is
> working,
> > > the statistics are empty
> > >
> > > #master
> > > postgres=# select * from pg_stat_replication ;
> > > (0 rows)
> > >
> > > #slave
> > > postgres=# select * from pg_stat_subscription ;
> > > -[ RECORD 1 ]---------+---------
> > > subid | 16472
> > > subname | test_sub
> > > pid |
> > > relid |
> > > received_lsn |
> > > last_msg_send_time |
> > > last_msg_receipt_time |
> > > latest_end_lsn |
> > > latest_end_time |
> > >
> > > Should be some enabled?
> > >
> >
> > If the subscription is disabled, the statistics of subscription is
> > empty and no wal sender processes launch. The test_sub can start the
> > replication by ALTER SUBSCRIPTION test_sub ENABLE.
> >
> >
> > I used this subscriptions for and it was warking.
>
>
> If there is no pid, the worker is not running. And if there is nothing
> in pg_stat_replication on master, the walsender is not running either,
> so it seems like it's not actually working.
>

I had two instances on one server with different port. I am sure, so
replication was functional. Only one issue is statistics

Master:

CREATE TABLE foo(id int primary key, a int);
CREATE PUBLICATION test_pub FOR TABLE foo;
INSERT INTO foo VALUES(1, 200);

slave

CREATE TABLE foo(id int primary key, a int);
CREATE SUBSCRIPTION test_sub CONNECTION 'port=5432' PUBLICATION test_pub;

That was all

> --
> Petr Jelinek http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Training & Services
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2017-09-25 16:36:44 Re: CREATE COLLATION does not sanitize ICU's BCP 47 language tags. Should it?
Previous Message Petr Jelinek 2017-09-25 16:31:32 Re: bgw_type (was Re: Why does logical replication launcher set application_name?)