Let's say if I am using asynchronous streaming replication with the below configuration in a 3 node cluster with Postgres 10.4 and Patroni 1.4.4
bootstrap: dcs: ttl: 30 loop_wait: 10 retry_timeout: 10 maximum_lag_on_failover: 1048576 postgresql: use_pg_rewind: true use_slots: true parameters: archive_mode: "off" wal_level: hot_standby max_wal_senders: 10 wal_keep_segments: 100 max_replication_slots: 10 hot_standby: "on" wal_log_hints: "on" unix_socket_directories: '/tmp' max_connections: 400 shared_buffers: 250MB autovacuum_analyze_scale_factor: 0.05 autovacuum_vacuum_scale_factor: 0.10 log_autovacuum_min_duration: 0 autovacuum_naptime: 15s autovacuum_max_workers: 6
Let's say one of the slave node suddenly lose its connection to master for long time.
- In this case I think the size of XLOG on master will keep on building as the the XLOG are not being consumed by the disconnected slave's replication slot. So is there any setting in patroni configuration which will remove the slave and remove its replication slot if it is disconnected from master for x time duration?
- What is the recommended way to handle this case?