Skip to content

Commit

Permalink
postgres: also fetch wals during pg_basebackup
Browse files Browse the repository at this point in the history
Also fetch wals when calling pg_basebackup. We could also stream them but this
will require an additional connection and wal sender so for now, since we are
using replication slots, just rely on fetching at the end of the basebackup.

This will fix pg_basebackup waiting indefinetly if archive mode is enabled but
the archive command on the primary isn't working correctly.
  • Loading branch information
sgotti committed Sep 4, 2017
1 parent 4973929 commit a51c917
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/postgresql/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ func (p *Manager) SyncFromFollowed(followedConnParams ConnParams) error {

log.Infow("running pg_basebackup")
name := filepath.Join(p.pgBinPath, "pg_basebackup")
cmd := exec.Command(name, "-R", "-D", p.dataDir, "-d", followedConnString)
cmd := exec.Command(name, "-R", "-Xf", "-D", p.dataDir, "-d", followedConnString)
cmd.Env = append(os.Environ(), fmt.Sprintf("PGPASSFILE=%s", pgpass.Name()))
log.Debugw("execing cmd", "cmd", cmd)

Expand Down

0 comments on commit a51c917

Please sign in to comment.