D22: every restore puts the data back exactly on failure and after a power cut (R-1177, R-1195); whole restore asks the unit first (R-1178); no mirror during a restore (R-1180); W22 restore refusals in Hungarian; unreleased
gates / gates (push) Successful in 1m40s
gates / gates (push) Successful in 1m40s
This commit is contained in:
@@ -134,6 +134,15 @@ func (m *Manager) planLiveVolumeCopy(vols []string) (need int64, exists map[stri
|
||||
// copyLiveVolumes tars every existing volume of the plan into a fresh restoreUndoDir. Runs with the app
|
||||
// STOPPED, so each copy is consistent. On any error the partial copy is removed and nothing has moved yet.
|
||||
func (m *Manager) copyLiveVolumes(stack, nsRoot string, vols []string, exists map[string]bool) (*liveVolumeCopy, error) {
|
||||
// D22: when none of the volumes exists there is nothing to copy — the copy is the list of volumes the backup adds
|
||||
// (removed on a put-back), with no folder.
|
||||
none := true
|
||||
for _, v := range vols {
|
||||
none = none && !exists[v]
|
||||
}
|
||||
if none {
|
||||
return &liveVolumeCopy{absent: append([]string(nil), vols...)}, nil
|
||||
}
|
||||
dir := filepath.Join(restoreUndoDir(nsRoot, stack), time.Now().UTC().Format("20060102T150405Z"))
|
||||
if err := os.MkdirAll(dir, 0o700); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user