Skip to content

Commit bd6f6f6

Browse files
committed
fix: not to create recovery.conf/standby.signal files if recovery configuration is empty (#233)
1 parent 70d9e7c commit bd6f6f6

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

configs/config.example.physical_generic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ retrieval:
178178
# complicated snippet, create a shell script, use --mount (-v) option
179179
# when starting a container with Database Lab and use path to it here.
180180
# Write your data to dataDir defined in "global.config"
181-
command: "pg_basebackup -X stream -D /var/lib/dblab/data"
181+
command: "pg_basebackup -X stream -D /var/lib/dblab/dblab_pool/data"
182182

183183
# PostgreSQL "restore_command" configuration option.
184184
restore_command: ""

pkg/services/provision/databases/postgres/pgconfig/configuration.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,17 +296,21 @@ func (m *Manager) AdjustRecoveryFiles() error {
296296
return errors.Wrap(err, "failed to truncate pg_ident.conf")
297297
}
298298

299+
return nil
300+
}
301+
302+
// ApplyRecovery applies recovery configuration parameters.
303+
func (m *Manager) ApplyRecovery(cfg map[string]string) error {
304+
if len(cfg) == 0 {
305+
return nil
306+
}
307+
299308
if m.pgVersion >= defaults.PGVersion12 {
300309
if err := tools.TouchFile(path.Join(m.dataDir, "standby.signal")); err != nil {
301310
return err
302311
}
303312
}
304313

305-
return nil
306-
}
307-
308-
// ApplyRecovery applies recovery configuration parameters.
309-
func (m *Manager) ApplyRecovery(cfg map[string]string) error {
310314
if err := tools.TouchFile(path.Join(m.dataDir, m.recoveryFilename())); err != nil {
311315
return err
312316
}

0 commit comments

Comments
 (0)