From 533ba59f350a8038ec12a4130c0940e398bb4914 Mon Sep 17 00:00:00 2001 From: ashmrtn <3891298+ashmrtn@users.noreply.github.com> Date: Fri, 25 Aug 2023 11:38:42 -0700 Subject: [PATCH] Minor log fixups for snapshots (#4113) * Fix log message during hierarchy merging so it's not as confusing * add reason for making a snapshot. This can be used to separate out later messages into item data snapshot and details snapshot during debugging --- #### Does this PR need a docs update or release note? - [ ] :white_check_mark: Yes, it's included - [ ] :clock1: Yes, but in a later PR - [x] :no_entry: No #### Type of change - [ ] :sunflower: Feature - [ ] :bug: Bugfix - [ ] :world_map: Documentation - [ ] :robot: Supportability/Tests - [ ] :computer: CI/Deployment - [x] :broom: Tech Debt/Cleanup #### Test Plan - [x] :muscle: Manual - [ ] :zap: Unit test - [ ] :green_heart: E2E --- src/internal/kopia/upload.go | 4 ++-- src/internal/operations/backup.go | 5 ++++- src/internal/streamstore/streamstore.go | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/internal/kopia/upload.go b/src/internal/kopia/upload.go index cca7c691f..bdd3f2444 100644 --- a/src/internal/kopia/upload.go +++ b/src/internal/kopia/upload.go @@ -877,8 +877,8 @@ func traverseBaseDir( stats *count.Bus, ) error { ctx = clues.Add(ctx, - "old_dir_path", oldDirPath, - "expected_dir_path", expectedDirPath) + "old_parent_dir_path", oldDirPath, + "expected_parent_dir_path", expectedDirPath) if depth >= maxInflateTraversalDepth { return clues.New("base snapshot tree too tall").WithClues(ctx) diff --git a/src/internal/operations/backup.go b/src/internal/operations/backup.go index 9215bc0d5..049686bcf 100644 --- a/src/internal/operations/backup.go +++ b/src/internal/operations/backup.go @@ -492,7 +492,10 @@ func consumeBackupCollections( isIncremental bool, errs *fault.Bus, ) (*kopia.BackupStats, *details.Builder, kopia.DetailsMergeInfoer, error) { - ctx = clues.Add(ctx, "collection_source", "operations") + ctx = clues.Add( + ctx, + "collection_source", "operations", + "snapshot_type", "item data") progressBar := observe.MessageWithCompletion(ctx, "Backing up data") defer close(progressBar) diff --git a/src/internal/streamstore/streamstore.go b/src/internal/streamstore/streamstore.go index 58f98f2a8..35a3b9706 100644 --- a/src/internal/streamstore/streamstore.go +++ b/src/internal/streamstore/streamstore.go @@ -61,6 +61,8 @@ func (ss *storeStreamer) Collect(ctx context.Context, col Collectable) error { // Write persists the collected objects in the stream store func (ss *storeStreamer) Write(ctx context.Context, errs *fault.Bus) (string, error) { + ctx = clues.Add(ctx, "snapshot_type", "stream store") + id, err := write(ctx, ss.kw, ss.dbcs, errs) if err != nil { return "", clues.Wrap(err, "writing to stream store")