Skip to content

Logical replication creates infinite loop of inserts #1085

@marceloneppel

Description

@marceloneppel

Steps to reproduce

  1. juju deploy postgresql --channel 16/edge postgresql1
  2. juju deploy postgresql --channel 16/edge postgresql2
  3. juju deploy data-integrator di1 --config database-name=testdb
  4. juju deploy data-integrator di2 --config database-name=testdb
  5. juju integrate postgresql1 di1
  6. juju integrate postgresql2 di2
  7. juju integrate postgresql1:logical-replication-offer postgresql2:logical-replication
  8. juju integrate postgresql1:logical-replication postgresql2:logical-replication-offer
  9. juju run di1/leader get-credentials
  10. psql PSQL URI FROM ABOVE
  11. create table asd (message int);\q
  12. juju run di2/leader get-credentials
  13. psql PSQL URI FROM ABOVE
  14. create table asd (message int);\q
  15. juju config postgresql1 logical_replication_subscription_request='{"testdb": ["public.asd"]}'
  16. juju config postgresql2 logical_replication_subscription_request='{"testdb": ["public.asd"]}'

Expected behavior

A blocked status message telling that the same table cannot be defined on both sides of the relation for the logical replication.

Actual behavior

An infinite loop of inserts happens due to the cyclic replication that was configured by configuring the same table on both sides of the relation.

Versions

Operating system: Ubuntu 24.04

Juju CLI: 3.6.8

Juju agent: 3.6.8

Charm revision: 867

LXD: 5.21/stable

Log output

Juju debug log: no relevant logs.

Additional context

The table needs to be empty in both clusters; otherwise, the charm will properly set a blocked status indicating the table is not empty in one of the clusters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions