Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allocwatcher: don't destroy local allocdir after migration #18108

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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 {
schmichael marked this conversation as resolved.
Show resolved Hide resolved
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
Loading