diff --git a/.changelog/18108.txt b/.changelog/18108.txt new file mode 100644 index 00000000000..26e7d6b588e --- /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 2965e9f65bd..ac4ff02229f 100644 --- a/client/allocwatcher/alloc_watcher.go +++ b/client/allocwatcher/alloc_watcher.go @@ -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