Skip to content

Commit

Permalink
feat: add threads parameter to openGauss restore subcommand (#465)
Browse files Browse the repository at this point in the history
* feat: add threads parameter to restore command

* feat: add threadsnum to agent server

* feat: add threadsNum to cli

* chore: update opengauss mock
  • Loading branch information
mlycore authored Nov 16, 2023
1 parent d186b41 commit 3d87f11
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 121 deletions.
2 changes: 1 addition & 1 deletion pitr/agent/internal/handler/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func Restore(ctx *fiber.Ctx) (err error) {
}()

// restore data from backup
if err = pkg.OG.Restore(in.DnBackupPath, in.Instance, in.DnBackupID); err != nil {
if err = pkg.OG.Restore(in.DnBackupPath, in.Instance, in.DnBackupID, in.DnThreadsNum); err != nil {
efmt := "pkg.OG.Restore failure[path=%s,instance=%s,backupID=%s], err wrap: %w"
err = fmt.Errorf(efmt, in.DnBackupPath, in.Instance, in.DnBackupID, err)
status = "restore failure"
Expand Down
1 change: 1 addition & 0 deletions pitr/agent/internal/handler/view/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type RestoreIn struct {
Instance string `json:"instance"`
DnBackupPath string `json:"dn_backup_path"`
DnBackupID string `json:"dn_backup_id"`
DnThreadsNum uint8 `json:"dn_threads_num"`
}

//nolint:dupl
Expand Down
229 changes: 114 additions & 115 deletions pitr/agent/internal/pkg/mocks/opengauss.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3d87f11

Please sign in to comment.