diff --git a/src/internal/connector/exchange/service_iterators.go b/src/internal/connector/exchange/service_iterators.go index 49a167437..1ee6636fe 100644 --- a/src/internal/connector/exchange/service_iterators.go +++ b/src/internal/connector/exchange/service_iterators.go @@ -50,6 +50,11 @@ func filterContainersAndFillCollections( tombstones = makeTombstones(dps) ) + logger.Ctx(ctx).Infow( + "filling collections", + "metadata_count", + len(dps)) + // TODO(rkeepers): this should be passed in from the caller, probably // as an interface that satisfies the NewCollection requirements. // But this will work for the short term. @@ -185,6 +190,11 @@ func filterContainersAndFillCollections( graph.NewMetadataEntry(graph.PreviousPathFileName, currPaths), } + logger.Ctx(ctx).Infow( + "adding metadata collection entries", + "num_paths_entries", len(currPaths), + "num_deltas_entries", len(deltaURLs)) + if len(deltaURLs) > 0 { entries = append(entries, graph.NewMetadataEntry(graph.DeltaURLsFileName, deltaURLs)) } diff --git a/src/internal/connector/onedrive/collections.go b/src/internal/connector/onedrive/collections.go index 749e865a8..f770dbbfe 100644 --- a/src/internal/connector/onedrive/collections.go +++ b/src/internal/connector/onedrive/collections.go @@ -295,6 +295,18 @@ func (c *Collections) Get( prevDelta := prevDeltas[driveID] oldPaths := oldPathsByDriveID[driveID] + numOldDelta := 0 + if len(prevDelta) > 0 { + numOldDelta++ + } + + logger.Ctx(ctx).Infow( + "previous metadata for drive", + "num_paths_entries", + len(oldPaths), + "num_deltas_entries", + numOldDelta) + delta, paths, excluded, err := collectItems( ctx, c.itemPagerFunc( @@ -312,6 +324,9 @@ func (c *Collections) Get( return nil, nil, err } + // Used for logging below. + numDeltas := 0 + // It's alright to have an empty folders map (i.e. no folders found) but not // an empty delta token. This is because when deserializing the metadata we // remove entries for which there is no corresponding delta token/folder. If @@ -319,6 +334,7 @@ func (c *Collections) Get( // for collections when not actually getting delta results. if len(delta.URL) > 0 { deltaURLs[driveID] = delta.URL + numDeltas++ } // Avoid the edge case where there's no paths but we do have a valid delta @@ -329,6 +345,13 @@ func (c *Collections) Get( maps.Copy(folderPaths[driveID], paths) maps.Copy(excludedItems, excluded) + + logger.Ctx(ctx).Infow( + "persisted metadata for drive", + "num_paths_entries", + len(paths), + "num_deltas_entries", + numDeltas) } observe.Message(ctx, observe.Safe(fmt.Sprintf("Discovered %d items to backup", c.NumItems)))