diff --git a/.changelog/18108.txt b/.changelog/18108.txt new file mode 100644 index 000000000..26e7d6b58 --- /dev/null +++ b/.changelog/18108.txt @@ -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 +``` diff --git a/client/allocwatcher/alloc_watcher.go b/client/allocwatcher/alloc_watcher.go index 1df200e3b..9dc5f95d1 100644 --- a/client/allocwatcher/alloc_watcher.go +++ b/client/allocwatcher/alloc_watcher.go @@ -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