0

Postgres logical replication not working

we have created logical replication slot on pg 10 using below command

select * 
from pg_create_logical_replication_slot('slot', 'wal2json');

Above request creates slot on database

 select * from pg_replication_slots; 

enter image description here

PG replication not returning stream events using slot listen command.

Slots size automatically increases to high value.

Below are postgress level global configs

archive_mode=off
archive_command=(disabled)
ssl=off
wal_level=logical
shared_preload_libraries=decoderbufs, wal2json
wal_keep_segments=100
max_replication_slots=100
max_wal_senders=30
wal_sender_timeout=0
max_standby_streaming_delay=-1

Question:

  1. What is best configuration for pg logical replication to fix our issue?
  2. Which is best plugin for logical replication our of below options:
    • wal2json
    • test decoding
    • protobuf

Please provide inputs to fix our issue.

  • Did you add tables to the subscriber? – a_horse_with_no_name Aug 22 at 16:56
  • We are using JDBC replication connection to listen wal .how to add table subscribers ? – vaibhav.patil Aug 22 at 17:01
  • 1
    How can you tell that replication is not working as expected? Does wal2json not receive the subscribed changes? – Laurenz Albe Aug 22 at 17:32
  • yes , I have try even using test_decode plugin in that also I am not getting events from table for changes – vaibhav.patil Aug 22 at 17:35
  • There is one java client I have wrote , which create replication slot and connection. once replication connection connects to slot I am not getting wal events. what is replication configuration do I need to set on server to work this ? gist.githubusercontent.com/vaibhavpatil123/… – vaibhav.patil Aug 22 at 17:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.