R-1251: sync the restore copy's folders before the marker names it (a cut left undo.json as .tmp on Tester 1); the interrupted-restore record says the put-back waits, not 'run it again'. Commit only.
gates / gates (push) Successful in 1m24s
gates / gates (push) Successful in 1m24s
This commit is contained in:
@@ -33,6 +33,9 @@ const RestoreInterruptedKey = "note.restore.interrupted"
|
||||
// (D22, R-1195): the data is as it was before the restore.
|
||||
const RestoreInterruptedPutBackKey = "note.restore.interrupted_put_back"
|
||||
|
||||
// RestoreInterruptedWaitingKey (R-1251): the interrupted restore's put-back waits for the app's drive.
|
||||
const RestoreInterruptedWaitingKey = "note.restore.interrupted_put_back_waiting"
|
||||
|
||||
// restoreRecordFile is the on-disk shape.
|
||||
type restoreRecordFile struct {
|
||||
Running bool `json:"running"`
|
||||
@@ -53,12 +56,12 @@ func (m *Manager) SetRestoreRecordPath(path string) {
|
||||
// LoadRestoreRecord restores the record at startup. It returns the restore that was interrupted by the
|
||||
// stop — non-nil exactly once per interruption — so the caller can log it and raise restore_interrupted.
|
||||
func (m *Manager) LoadRestoreRecord() *RestoreOpResult {
|
||||
return m.LoadRestoreRecordAfterRecovery(nil)
|
||||
return m.LoadRestoreRecordAfterRecovery(nil, nil)
|
||||
}
|
||||
|
||||
// LoadRestoreRecordAfterRecovery is LoadRestoreRecord told which apps the start-up crash recovery put back
|
||||
// (AppStopRecovery.PutBack, D22 / R-1195): for those the interrupted restore reads „the data is as before".
|
||||
func (m *Manager) LoadRestoreRecordAfterRecovery(putBack []string) *RestoreOpResult {
|
||||
func (m *Manager) LoadRestoreRecordAfterRecovery(putBack, waiting []string) *RestoreOpResult {
|
||||
m.mu.Lock()
|
||||
defer m.mu.Unlock()
|
||||
if m.opRecordPath == "" {
|
||||
@@ -95,6 +98,11 @@ func (m *Manager) LoadRestoreRecordAfterRecovery(putBack []string) *RestoreOpRes
|
||||
res.Message, res.PutBack = m.note(RestoreInterruptedPutBackKey), true
|
||||
}
|
||||
}
|
||||
for _, w := range waiting {
|
||||
if w == rec.Stack {
|
||||
res.Message, res.PutBackWaiting = m.note(RestoreInterruptedWaitingKey), true
|
||||
}
|
||||
}
|
||||
m.opLast = &res
|
||||
if m.opInterrupted == nil {
|
||||
m.opInterrupted = map[string]RestoreOpResult{}
|
||||
|
||||
Reference in New Issue
Block a user