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

cleanup msgpack related str/bytes mess #6668

Conversation

ThomasWaldmann
Copy link
Member

@ThomasWaldmann ThomasWaldmann commented May 5, 2022

based on #6663, see the commits not prefixed with transfer:.

@ThomasWaldmann ThomasWaldmann changed the title msgpack str bytes cleanup cleanup msgpack related str/bytes mess May 5, 2022
@ThomasWaldmann ThomasWaldmann force-pushed the msgpack-str-bytes-cleanup branch 2 times, most recently from 2b5c32b to 47304cd Compare May 5, 2022 17:43
@ThomasWaldmann ThomasWaldmann marked this pull request as draft May 5, 2022 18:31
@ThomasWaldmann ThomasWaldmann force-pushed the msgpack-str-bytes-cleanup branch 2 times, most recently from 1bb35c6 to cfdcf28 Compare May 5, 2022 22:54
@codecov-commenter
Copy link

codecov-commenter commented May 5, 2022

Codecov Report

Merging #6668 (e0f65d4) into master (dc89798) will decrease coverage by 0.67%.
The diff coverage is 54.95%.

@@            Coverage Diff             @@
##           master    #6668      +/-   ##
==========================================
- Coverage   82.75%   82.08%   -0.68%     
==========================================
  Files          39       39              
  Lines       10739    10827      +88     
  Branches     2113     2129      +16     
==========================================
  Hits         8887     8887              
- Misses       1330     1415      +85     
- Partials      522      525       +3     
Impacted Files Coverage Δ
src/borg/archiver.py 75.99% <19.56%> (-2.56%) ⬇️
src/borg/remote.py 79.45% <62.50%> (-0.07%) ⬇️
src/borg/repository.py 82.44% <68.75%> (ø)
src/borg/cache.py 85.02% <83.33%> (+0.01%) ⬆️
src/borg/helpers/manifest.py 93.60% <90.00%> (-0.15%) ⬇️
src/borg/archive.py 81.89% <100.00%> (-0.30%) ⬇️
src/borg/constants.py 100.00% <100.00%> (ø)
src/borg/crypto/key.py 88.97% <100.00%> (ø)
src/borg/helpers/msgpack.py 87.73% <100.00%> (+1.42%) ⬆️
src/borg/helpers/parseformat.py 89.14% <100.00%> (-0.93%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dc89798...e0f65d4. Read the comment docs.

@ThomasWaldmann ThomasWaldmann force-pushed the msgpack-str-bytes-cleanup branch 2 times, most recently from 0e7d0ae to e0f65d4 Compare May 6, 2022 03:00
this is somehow similar to borg recreate,
but with different focus and way simpler:

not changing compression algo
not changing chunking
not excluding files inside an archive by path match
only dealing with complete archives

but:
different src and dst repo
only reading each chunk once
keeping the compressed payload (no decompression/recompression effort)
--dry-run can be used before and afterwards to check
hack: see the docstring of ZLIB_legacy class.

New clean ZLIB class that works as every other compressor.

ZLIB ID 0x0500, ZLIB_legacy ID 0x.8..
Item.hlid: same id, same hardlink (xxh64 digest)
Item.hardlink_master: not used for new archives any more
Item.source: not used for hardlink slaves any more
…gbackup#2323

Timestamp scales to 64 or 96bit serialization formats, that should be enough for everybody.

We use this in archived items and also in the files cache.
see ticket and borg.helpers.msgpack docstring.
see ticket and borg.helpers.msgpack docstring.

this changeset implements the full migration to
msgpack 2.0 spec (use_bin_type=True, raw=False).

still needed compat to the past is done via want_bytes decoder in borg.item.
@ThomasWaldmann
Copy link
Member Author

ThomasWaldmann commented May 18, 2022

will redo this PR against borg2 branch. #6704

@ThomasWaldmann ThomasWaldmann deleted the msgpack-str-bytes-cleanup branch May 18, 2022 15:20
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.

2 participants