backport of commit a3a637ee8efe5e1251f60f781369bd9052c4d4a2 (#18132)
This pull request was automerged via backport-assistant
This commit is contained in:
parent
e9b6be87e2
commit
9301daa8e8
|
@ -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
|
||||
```
|
|
@ -279,15 +279,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
|
||||
|
|
Loading…
Reference in New Issue