Mark snapshots missing backup as assist bases (#3618)

Loosen restrictions slightly by returning snapshots that are missing their bakcup or details models as assist bases that can be used by kopia assisted incrementals.

---

#### Does this PR need a docs update or release note?

- [ ]  Yes, it's included
- [ ] 🕐 Yes, but in a later PR
- [x]  No

#### Type of change

- [ ] 🌻 Feature
- [x] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Supportability/Tests
- [ ] 💻 CI/Deployment
- [ ] 🧹 Tech Debt/Cleanup

#### Issue(s)

* #3525

#### Test Plan

- [ ] 💪 Manual
- [x]  Unit test
- [ ] 💚 E2E
This commit is contained in:
ashmrtn 2023-06-14 11:57:40 -07:00 committed by GitHub
parent 8996d3edab
commit d415be6844
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 0 deletions

View File

@ -192,6 +192,8 @@ func (b *baseFinder) findBasesInSet(
Manifest: man,
Reasons: []Reason{reason},
})
logger.Ctx(ictx).Info("found incomplete backup")
}
continue
@ -203,6 +205,18 @@ func (b *baseFinder) findBasesInSet(
// Safe to continue here as we'll just end up attempting to use an older
// backup as the base.
logger.CtxErr(ictx, err).Debug("searching for base backup")
if !foundIncomplete {
foundIncomplete = true
kopiaAssistSnaps = append(kopiaAssistSnaps, ManifestEntry{
Manifest: man,
Reasons: []Reason{reason},
})
logger.Ctx(ictx).Info("found incomplete backup")
}
continue
}
@ -216,6 +230,19 @@ func (b *baseFinder) findBasesInSet(
"empty backup stream store ID",
"search_backup_id", bup.ID)
if !foundIncomplete {
foundIncomplete = true
kopiaAssistSnaps = append(kopiaAssistSnaps, ManifestEntry{
Manifest: man,
Reasons: []Reason{reason},
})
logger.Ctx(ictx).Infow(
"found incomplete backup",
"search_backup_id", bup.ID)
}
continue
}

View File

@ -436,6 +436,7 @@ func (suite *BaseFinderUnitSuite) TestGetBases() {
1: testUser1Mail,
},
expectedAssistManifestReasons: map[int][]Reason{
0: testUser1Mail,
1: testUser1Mail,
},
backupData: []backupInfo{
@ -470,6 +471,7 @@ func (suite *BaseFinderUnitSuite) TestGetBases() {
1: testUser1Mail,
},
expectedAssistManifestReasons: map[int][]Reason{
0: testUser1Mail,
1: testUser1Mail,
},
backupData: []backupInfo{