2ndQuadrant / pglogical

Logical Replication extension for PostgreSQL 17, 16, 15, 14, 13, 12, 11, 10, 9.6, 9.5, 9.4 (Postgres), providing much faster replication than Slony, Bucardo or Londiste, as well as cross-version upgrades.
http://2ndquadrant.com/en/resources/pglogical/
Other
1k stars 153 forks source link

Can a single replication set support multiple subscribers #372

Closed PenguinFlyingHigh closed 2 years ago

PenguinFlyingHigh commented 2 years ago

Looking at the documentation, I don't see it specified anywhere if multiple subscribers can subscribe to the same replication set?

From the testing that we've tried, it seems that only 1 of the subscriber can successfully subscribe to the replication set and other subscribers will be able to bulk load but not carry on with streaming.

On subscriber node 1

SELECT pglogical.create_subscription(
    subscription_name := '1_subscription',
    provider_dsn := 'provider connection string',
    replication_sets := ARRAY['same_replication_set'],
    synchronize_data := true,
    forward_origins := '{}'
);

On subscriber node 2

SELECT pglogical.create_subscription(
    subscription_name := '2_subscription',
    provider_dsn := 'host= provider connection string,
    replication_sets := ARRAY['same_replication_set'],
    synchronize_data := true,
    forward_origins := '{}'
);
bonesmoses commented 2 years ago

That is most definitely not the case. Pglogical just uses the logical replication stream, and each subscribing system gets its own independent replication slot and associated WAL stream for data modifications. It's not mentioned in the documentation because there is no such limit. Provided your Postgres system is properly configured and can support the number of streaming replicas, they will all work as expected.