Skip to content

Commit 1582544

Browse files
authored
Merge pull request #22 from fly-apps/enable-replication-slots
Enable replication slots
2 parents c05e48c + 7ee3543 commit 1582544

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

pkg/flypg/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ func (c *Config) SetDefaults() error {
4848
c.pgConfig = map[string]interface{}{
4949
"shared_buffers": fmt.Sprintf("%dMB", mem/4),
5050
"max_wal_senders": 10,
51+
"max_replication_slots": 10,
5152
"max_connections": 300,
5253
"wal_level": "hot_standby",
5354
"hot_standby": true,

pkg/flypg/repmgr.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ func (r *RepMgr) writeManagerConf() error {
9090
"conninfo": fmt.Sprintf("'host=%s port=%d user=%s dbname=%s connect_timeout=10'", r.PrivateIP, r.Port, r.Credentials.Username, r.DatabaseName),
9191
"data_directory": fmt.Sprintf("'%s'", r.DataDir),
9292
"failover": "'automatic'",
93+
"use_replication_slots": "yes",
9394
"promote_command": fmt.Sprintf("'repmgr standby promote -f %s --log-to-file'", r.ConfigPath),
9495
"follow_command": fmt.Sprintf("'repmgr standby follow -f %s --log-to-file --upstream-node-id=%%n'", r.ConfigPath),
9596
"event_notification_command": fmt.Sprintf("'/usr/local/bin/event_handler -node-id %%n -event %%e -success %%s -details \"%%d\" -new-node-id \\'%%p\\''"),

0 commit comments

Comments
 (0)