Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper synchronization of logical replication slots between Primary and Standby. #33

Open
AMamoutkine opened this issue Dec 9, 2023 · 2 comments

Comments

@AMamoutkine
Copy link

Greetings,

Is it possible to provide a semi-universal example of the pg-failover-slots configuration.

I try to do configuration according to existing documentation - replication slot(s) do not appear on the standby node during the clone from the primary or if I create replication slot later after operational failover cluster created (prime and standby nodes registered). Obviously, after Prime failure and Standby promotion as a new Prime, the replication slot is absent on the new Prime node.

As an example, failover cluster {Prime : pg14, Standby : pg14}, using EDB repmgr; [client : pg14]. Prime has logical replication publication test_pub for all tables of testdb. Client has logical replication subscription test_sub to the Prime.

How to configure postgresql.conf on Prime and Standby, so test_sub replication slot will be existed on the Standby, and synchronized between Prime and Standby.

Here is a configuration, that I tried and which is not working:
Installed on Prime and Standby edb-pg14-pg-failover-slots1
[postgresql.conf]:
shared_preload_libraries = 'repmgr, pg_failover_slots'
pg_failover_slots.synchronize_slot_names='name_like:%' # would like to synchronize all available replication slots
pg_failover_slots.standby_slot_names='name_like:%'

I also tried:
pg_failover_slots.standby_slots_min_confirmed = -1
Did not help.

Your help would be greatly appreciated!

@nick-ivanov-edb
Copy link

I don't think that pg_failover_slots.standby_slot_names='name_like:%' is going to work. If pg_failover_slots works correctly, a slot created on the primary should also be created on the standby. If that's not happening, you need to find why. There are probably some messages in the log on the standby.

@99hops
Copy link

99hops commented Nov 14, 2024

@nick-ivanov-edb Hello mate, do you know what is the relation of sync_replication_slots in this case?
Now there is also pg_create_logical_replication_slot fifth param failover = true, which also adds to the confusion (;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants