Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache.py: be less verbose during cache sync #7277

Merged
merged 3 commits into from
Jan 19, 2023

Conversation

jdchristensen
Copy link
Contributor

As discussed in #7271, this makes borg2 less verbose when it is syncing the cache. (This only happens if you access a repository from multiple hosts.) Below is how the new output looks with -v and with --debug. (With neither, there is no relevant output.)

(borg2-env) borg2-test$ export BORG_BASE_DIR=./borg2-base-dir
(borg2-env) borg2-test$ borg create -v host1test20 ./test-data/
Creating archive at "/t/borg2-test/test.repo"
Cached archive chunk indexes: 7 fresh, 0 stale, 2 need fetching.
Reading cached archive chunk index for host1test17
Reading cached archive chunk index for host1test18
Fetching and building archive index for host1test19
Reading cached archive chunk index for host1test2
Reading cached archive chunk index for host2test17
Fetching and building archive index for host2test19
Reading cached archive chunk index for host2test2
Reading cached archive chunk index for host2test3
Reading cached archive chunk index for host2test4

(borg2-env) borg2-test$ export BORG_BASE_DIR=./borg2-base-dir2
(borg2-env) borg2-test$ borg create --debug host2test20 ./test-data/
[Only cache-related output shown.]
Synchronizing chunks cache...
Cached archive chunk indexes: 8 fresh, 0 stale, 2 need fetching.
Reading cached archive chunk index for host1test17
Verified integrity of ./borg2-base-dir2/.cache/borg/c538429994580bb5ad6b23ac1cf1f611c6495c61f27630e5b4b3ab595688353d/chunks.archive.d/f7d238fd1895ab43dbfdce2efd5a46a721f47a13b3c29971347945f76aad991a.compact
Merging into master chunks index
...
Fetching and building archive index for host1test20
Merging into master chunks index
Reading cached archive chunk index for host2test17
Verified integrity of ./borg2-base-dir2/.cache/borg/c538429994580bb5ad6b23ac1cf1f611c6495c61f27630e5b4b3ab595688353d/chunks.archive.d/0e92529973dc6902dcef61c2ac3ed6746bffae6fa96421f904472b52946f2a35.compact
Merging into master chunks index
...
Cache sync: processed 576.92 kB (6 chunks) of metadata
Cache sync: compact chunks.archive.d storage saved 76.72 kB bytes
Cache sync done.
...
(borg2-env) borg2-test$ 

I'd also be ok with showing less with -v if people prefer. Note that I removed a few places with ... in the output to make it look tidier, but I can reverse those.

Copy link
Member

@ThomasWaldmann ThomasWaldmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

We could improve consistency of wording a bit, while we are at it. When I wrote this, I seemed to be undecided about chunks cache vs. chunks index, but guess the latter describes it better.

A small nitpick about "...": when I used this, it wanted to indicate that there is something ongoing after this (usually either followed by some lines of further infos while it is progressing and/or terminated by some "Done." when it is finished).

Maybe either keep that or terminate the sentence with a ".".

@codecov-commenter
Copy link

codecov-commenter commented Jan 18, 2023

Codecov Report

Merging #7277 (6f7bc89) into master (1df7c24) will increase coverage by 0.00%.
The diff coverage is 83.33%.

@@           Coverage Diff           @@
##           master    #7277   +/-   ##
=======================================
  Coverage   83.42%   83.42%           
=======================================
  Files          67       67           
  Lines       11582    11585    +3     
  Branches     2102     2103    +1     
=======================================
+ Hits         9662     9665    +3     
  Misses       1363     1363           
  Partials      557      557           
Impacted Files Coverage Δ
src/borg/cache.py 85.58% <83.33%> (ø)
src/borg/helpers/parseformat.py 89.31% <0.00%> (-0.02%) ⬇️
src/borg/archiver/prune_cmd.py 89.06% <0.00%> (ø)
src/borg/helpers/shellpattern.py 100.00% <0.00%> (ø)
src/borg/upgrade.py 75.53% <0.00%> (+1.08%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@jdchristensen
Copy link
Contributor Author

Let me know how the latest commit looks. I left the initial "..." to pair with the final "done".

@ThomasWaldmann
Copy link
Member

Much better consistency. But some places now say "cache index", that should be also "chunks index".

That master chunks file it updates there has a mapping chunkid -> (refcount, size).

@jdchristensen
Copy link
Contributor Author

Hopefully I've got it right now!

@ThomasWaldmann ThomasWaldmann merged commit be1048a into borgbackup:master Jan 19, 2023
@ThomasWaldmann
Copy link
Member

Thanks!

@jdchristensen jdchristensen deleted the chunks-cache-output branch January 19, 2023 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants