Compare commits

...

3 Commits

Author SHA1 Message Date
Ashlie Martinez
dab4bf6e35 Log base item kopia mod time 2023-09-27 14:33:24 -07:00
Ashlie Martinez
43af122fe0 Log item size and path for base items 2023-09-27 11:40:04 -07:00
Ashlie Martinez
8170074303 Additional logging during details creation 2023-09-27 09:08:18 -07:00
2 changed files with 29 additions and 4 deletions

View File

@ -217,6 +217,11 @@ func (cp *corsoProgress) FinishedFile(relativePath string, err error) {
cp.mu.Lock() cp.mu.Lock()
defer cp.mu.Unlock() defer cp.mu.Unlock()
logger.Ctx(ctx).Debugw(
"adding merger entry",
"item_mod_time", d.modTime,
"item_prev_path", d.prevPath)
err := cp.toMerge.addRepoRef( err := cp.toMerge.addRepoRef(
d.prevPath.ToBuilder(), d.prevPath.ToBuilder(),
d.modTime, d.modTime,
@ -586,6 +591,12 @@ func streamBaseEntries(
progress.put(encodeAsPath(itemPath.PopFront().Elements()...), d) progress.put(encodeAsPath(itemPath.PopFront().Elements()...), d)
} }
logger.Ctx(ctx).Debugw(
"uploading base item",
"item_size", entry.Size(),
"item_mod_time", entry.ModTime(),
"item_repo_ref", itemPath)
if err := ctr(ctx, entry); err != nil { if err := ctr(ctx, entry); err != nil {
return clues.Wrap(err, "executing callback on item"). return clues.Wrap(err, "executing callback on item").
WithClues(ctx). WithClues(ctx).

View File

@ -635,6 +635,13 @@ func mergeItemsFromBase(
With("repo_ref", path.LoggableDir(entry.RepoRef)) With("repo_ref", path.LoggableDir(entry.RepoRef))
} }
ictx := clues.Add(
ctx,
"item_repo_ref",
rr,
"item_mod_time",
entry.Modified())
// Although this base has an entry it may not be the most recent. Check // Although this base has an entry it may not be the most recent. Check
// the reasons a snapshot was returned to ensure we only choose the recent // the reasons a snapshot was returned to ensure we only choose the recent
// entries. // entries.
@ -645,16 +652,16 @@ func mergeItemsFromBase(
// with overlapping reasons that then turn into assist bases, but the // with overlapping reasons that then turn into assist bases, but the
// modTime check in DetailsMergeInfoer should handle that. // modTime check in DetailsMergeInfoer should handle that.
if checkReason && !matchesReason(baseBackup.Reasons, rr) { if checkReason && !matchesReason(baseBackup.Reasons, rr) {
logger.Ctx(ictx).Debug("reason match failure")
continue continue
} }
// Skip items that were already found in a previous base backup. // Skip items that were already found in a previous base backup.
if _, ok := alreadySeenItems[rr.ShortRef()]; ok { if _, ok := alreadySeenItems[rr.ShortRef()]; ok {
logger.Ctx(ictx).Debug("already seen")
continue continue
} }
ictx := clues.Add(ctx, "repo_ref", rr)
newPath, newLoc, err := getNewPathRefs( newPath, newLoc, err := getNewPathRefs(
dataFromBackup, dataFromBackup,
entry, entry,
@ -667,9 +674,12 @@ func mergeItemsFromBase(
// This entry isn't merged. // This entry isn't merged.
if newPath == nil { if newPath == nil {
logger.Ctx(ictx).Debug("no new path")
continue continue
} }
logger.Ctx(ictx).Debug("merged")
// Fixup paths in the item. // Fixup paths in the item.
item := entry.ItemInfo item := entry.ItemInfo
details.UpdateItem(&item, newLoc) details.UpdateItem(&item, newLoc)
@ -741,8 +751,10 @@ func mergeDetails(
// with overlapping Reasons that turn into assist bases, but the modTime check // with overlapping Reasons that turn into assist bases, but the modTime check
// in DetailsMergeInfoer should handle that. // in DetailsMergeInfoer should handle that.
for _, base := range bases.UniqueAssistBackups() { for _, base := range bases.UniqueAssistBackups() {
ictx := clues.Add(ctx, "base_type", "assist")
added, err := mergeItemsFromBase( added, err := mergeItemsFromBase(
ctx, ictx,
false, false,
base, base,
detailsStore, detailsStore,
@ -766,8 +778,10 @@ func mergeDetails(
// explicitly control which subtrees from the merge base backup are grafted // explicitly control which subtrees from the merge base backup are grafted
// onto the hierarchy for the currently running backup. // onto the hierarchy for the currently running backup.
for _, base := range bases.Backups() { for _, base := range bases.Backups() {
ictx := clues.Add(ctx, "base_type", "assist")
added, err := mergeItemsFromBase( added, err := mergeItemsFromBase(
ctx, ictx,
true, true,
base, base,
detailsStore, detailsStore,