Skip to content

Commit

Permalink
backport of commit a3a637e (#18131)
Browse files Browse the repository at this point in the history
This pull request was automerged via backport-assistant
  • Loading branch information
hc-github-team-nomad-core authored Aug 2, 2023
1 parent 4a644f5 commit 7188603
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
3 changes: 3 additions & 0 deletions .changelog/18108.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
migration: Fixed a bug where previous alloc logs were destroyed when migrating ephemeral_disk on the same client
```
10 changes: 1 addition & 9 deletions client/allocwatcher/alloc_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,7 @@ func (p *localPrevAlloc) Migrate(ctx context.Context, dest *allocdir.AllocDir) e

p.logger.Debug("copying previous alloc")

moveErr := dest.Move(p.prevAllocDir, p.tasks)

// Always cleanup previous alloc
if err := p.prevAllocDir.Destroy(); err != nil {
p.logger.Error("error destroying alloc dir",
"error", err, "previous_alloc_dir", p.prevAllocDir.AllocDir)
}

return moveErr
return dest.Move(p.prevAllocDir, p.tasks)
}

// remotePrevAlloc is a prevAllocWatcher for previous allocations on remote
Expand Down

0 comments on commit 7188603

Please sign in to comment.