Skip to content

Commit

Permalink
DEVOPS-30603: improve copy schema migration logging (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
bfabricio authored Jan 8, 2025
1 parent 66d73c5 commit e4a5f9a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/pgctl/pgctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,12 +376,11 @@ func (s *copy_schema_state) Execute() (State, error) {

restoreExec := restore.Exec(dumpExec.FileName, ExecOptions{StreamPrint: true})
if restoreExec.Error != nil {
log.Error(restoreExec.Error.Err, "restore failed")

log.Error(restoreExec.Error.Err, "restore failed", "cmd output", restoreExec.Error.CmdOutput)
// Attempt to drop schemas after restore failure.
dropResult := restore.DropSchemas()
if dropResult.Error != nil {
log.Error(dropResult.Error.Err, "failed to drop schemas")
log.Error(dropResult.Error.Err, "failed to drop schemas", "cmd output", dropResult.Error.CmdOutput)
return nil, dropResult.Error.Err
}

Expand Down

0 comments on commit e4a5f9a

Please sign in to comment.