pglogical cascading replication (chaining replication)

Поиск
Список
Период
Сортировка
От Nick Babadzhanian
Тема pglogical cascading replication (chaining replication)
Дата
Msg-id 1691408856.31522.1468333259045.JavaMail.zimbra@cobra.ru
обсуждение исходный текст
Ответы Re: pglogical cascading replication (chaining replication)  (Nick Babadzhanian <nb@cobra.ru>)
Re: pglogical cascading replication (chaining replication)  ("Joshua D. Drake" <jd@commandprompt.com>)
Список pgsql-general
I apologize if this is wrong place to ask the question.

A quote from pglogical FAQ:

> Q. Does pglogical support cascaded replication?
> Subscribers can be configured as publishers as well thus cascaded replication can be achieved
> by forwarding/chaining (again no failover though).

The only mentions of forwarding on documentation page are:

> Cascading replication is implemented in the form of changeset forwarding.

> forward_origins - array of origin names to forward, currently only supported values are empty
> array meaning don't forward any changes that didn't originate on provider node, or "{all}"
> which means replicate all changes no matter what is their origin, default is "{all}"

So my question is how to forward changeset using pglogical?

Here's my setup:

There are 3 identical CentOS 7 servers: p1, p2 and p3. Postgres version is 9.5.3.

p1:

select pglogical.create_node
(
    node_name := 'node_p1_provider',
    dsn := 'host=192.168.1.101 port=5432 dbname=test'
);

select pglogical.replication_set_add_all_tables('default_insert_only', array['public']);

p2:

select pglogical.create_node(
    node_name := 'node_p2_provider_and_subscriber',
    dsn := 'host=192.168.1.102 port=5432 dbname=test'
);

select pglogical.replication_set_add_all_tables('default_insert_only', array['public']);

select pglogical.create_subscription
(
    subscription_name => 'sub_p1_to_p2_insert_only',
    provider_dsn => 'host=192.168.1.101 port=5432 dbname=test',
    replication_sets => array['default_insert_only']
);

p3:

select pglogical.create_node(
    node_name := 'node_p3_subscriber',
    dsn := 'host=192.168.1.103 port=5432 dbname=test'
);

select pglogical.create_subscription
(
    subscription_name => 'sub_p2_to_p3_insert_only',
    provider_dsn => 'host=192.168.1.102 port=5432 dbname=test',
    replication_sets => array['default_insert_only']
);

Result:
p1:

insert into public.test (col1) values (1);
select count(1) from public.test; -- returns 1;

p2:
insert into public.test (col1) values (2);
select count(1) from public.test; -- returns 2;

p3:
select count(1) from public.test; -- returns 1;

Expected:
p3 recieves all inserts, thus the count on p3 should be 2 (same as on p2).


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Question about antijoin
Следующее
От: Nick Babadzhanian
Дата:
Сообщение: Re: Replication with non-read-only standby.