Skip to content

Commit 4778c63

Browse files
committed
fix: extend original params to synchronize on restore (#169)
1 parent eae64e9 commit 4778c63

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pkg/retrieval/engine/postgres/physical/physical.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ const (
4848

4949
var (
5050
// List of original parameters to synchronize on restore.
51-
originalParamsToRestore = []string{"max_connections"}
51+
originalParamsToRestore = map[string]string{
52+
"max_connections": "max_connections",
53+
"max_prepared_xacts": "max_prepared_transactions",
54+
"max_locks_per_xact": "max_locks_per_transaction",
55+
"max_worker_processes": "max_worker_processes",
56+
"track_commit_timestamp": "track_commit_timestamp",
57+
}
5258
)
5359

5460
// RestoreJob describes a job for physical restoring.
@@ -502,7 +508,7 @@ func (r *RestoreJob) extractInitParams(ctx context.Context, read io.Reader) (map
502508

503509
responseLine := scanner.Text()
504510

505-
for _, param := range originalParamsToRestore {
511+
for param, configName := range originalParamsToRestore {
506512
extractedName := param + settingSuffix
507513

508514
if !strings.HasPrefix(responseLine, extractedName) {
@@ -511,7 +517,7 @@ func (r *RestoreJob) extractInitParams(ctx context.Context, read io.Reader) (map
511517

512518
value := strings.TrimSpace(strings.TrimPrefix(responseLine, extractedName))
513519

514-
extractedConfigs[param] = value
520+
extractedConfigs[configName] = value
515521
}
516522

517523
if len(originalParamsToRestore) == len(extractedConfigs) {

0 commit comments

Comments
 (0)