Skip to content

Commit 50e2236

Browse files
committed
Explicitly enable "hot_standby" during restore
This parameter has been enabled by default since Postgres 10 and is unlikely to change, but we want the behavior, so we should set it.
1 parent 90c8447 commit 50e2236

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/pgbackrest/config.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func MakePGBackrestLogDir(template *corev1.PodTemplateSpec,
174174
func RestoreCommand(pgdata, hugePagesSetting, fetchKeyCommand string, tablespaceVolumes []*corev1.PersistentVolumeClaim, args ...string) []string {
175175

176176
// After pgBackRest restores files, PostgreSQL starts in recovery to finish
177-
// replaying WAL files. "hot_standby" is "on" (by default) so we can detect
177+
// replaying WAL files. "hot_standby" is "on" so we can detect
178178
// when recovery has finished. In that mode, some parameters cannot be
179179
// smaller than they were when PostgreSQL was backed up. Configure them to
180180
// match the values reported by "pg_controldata". Those parameters are also
@@ -233,6 +233,7 @@ cat > /tmp/postgres.restore.conf <<EOF
233233
archive_command = 'false'
234234
archive_mode = 'on'
235235
hba_file = '/tmp/pg_hba.restore.conf'
236+
hot_standby = 'on'
236237
max_connections = '${max_conn}'
237238
max_locks_per_transaction = '${max_lock}'
238239
max_prepared_transactions = '${max_ptxn}'

0 commit comments

Comments
 (0)