Comments (13)
so a few things about this:
- i agree it's important to avoid blowing up stuff
- if we're going to change the magic number, i think they should be versioned to cover for possible future changes in the data structures
- in that spirit, which change actually warranted such a change in the magic numbers? surely there's a change that makes the ondisk format incompatible anymore?
i think this is an important scenario we should deal with properly: we are changing the on-disk format. fine. but what does that entail? do we just do random changes and not look back? i believe we should be really careful when that happen and provide a migration path. migrating from attic to borg isn't much different from migrating between borg 1.x and 2.x, assuming 2.x introduces on-disk changes as well.
so my suggestion would be to not break the on-disk format without a very good reason (i guess that still needs to be defined, but it seems unclear to me right now what the reason for the above change is).
when the on-disk format is changed:
- it should be clearly documented as a change in internals.html
- ... but also in a "changelog-style" file (this is currently CHANGES, but this lacks details on how the changes impact older repositories
- the magic number needs to be incremented
- a migration layer of some sort needs to be implemented to convert older repository formats
does that make sense?
is it the right place to discuss such issues for the future?
from borg.
@anarcat the magics are not for versioning, but to tell (detect) whether the files are from this software (borg). That's one of the reasons why they say BORG and not ATTIC. See above for others.
There's already other information in the on-disk files to version the API level. Which is btw. another reason not to tell ATTIC in the magics - who says that attic api v3 will be same as borg api v3?
from borg.
@ThomasWaldmann Right okay, that makes sense. Still doesn't invalidate my points i believe. ;)
from borg.
As borg 0.x.x is now targetted to be attic + conservative changes, a one-time conversion from current(!) attic repos seems reasonable and doable. The converter has to be careful not to convert attic repos (from past or from future) that are incompatible.
The different BORG magics must stay as they are, for reasons outlined above.
from borg.
Note: I just started a bounty on BountySource for this ticket. The bounty is about implementing the code needed for doing a one-time conversion from attic to borg repositories (so attic users have a migration path without losing their repository or having to begin from scratch).
from borg.
i may just do this at some point, but i'm in kind of a squeeze until at least october... so first person to grab this gets the bounty yay! :)
from borg.
no one started on this yet?
from borg.
Not me at least (and I don't know of anybody else working on this).
from borg.
so in short, there are a few places that needs to be rewritten:
- key file:
s/ATTIC KEY/BORG_KEY/
inget_keys_dir()
, that is$ATTIC_KEYS_DIR
or$HOME/.(attic|borg)/keys
, that is loaded byKeyfileKey.find_key_file()
- that finds the keys with the right identifier for the repo, no need to decrypt to convert - repository segments:
s/ATTICSEG/BORG_SEG/
- luckily the segment length didn't change so we can just replace the 8 first bytes of all regular files in$ATTIC_REPO/data/**
, theRepository.segment_iterator()
can be used here - hash indexes:
s/ATTICIDX/BORG_IDX/
- and this is in a few locations:- the
files
andchunks
cache (in$HOME/.cache/attic/<repoid>/
), which we could just drop, but if we'd want to convert, we could open it with theCache.open()
, edit in place and thenCache.close()
to make sure we have locking right - the repository index (in
$ATTIC_REPO/index.%d
, where%d
is theRepository.get_index_transaction_id()
), which we should probably update, with a lock, seeRepository.open()
, which i'm not sure we should use because it may write data onRepository.close()
...
- the
i think that about covers it.
from borg.
unless the latter wasn't clear, i'm working on this here. :)
from borg.
let's move this fun stuff to the PR in #231.
from borg.
PR #231 closes this. Thanks to @anarcat we have a migration path now! \o/
from borg.
you're welcome :)
from borg.
Related Issues (20)
- disk is full: `_get_default_tempdir` raises `FileNotFoundError` No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/home/kmille'] HOT 7
- run in venv w/ root rights HOT 3
- As of 1.2.0, the ssh relative path hack "/./" works for most actions but not "borg init" HOT 4
- Please add a way to keep backups independently of pruning retention policy HOT 2
- ConnectionResetError: [Errno 104] Connection reset by peer HOT 3
- `borgfs` in Standalone Binary Installation Docs HOT 2
- Can't build borg on arm64 (armbian 22.04LTS) HOT 20
- Use multithreaded zstd compression HOT 9
- Security Feature: Error if local / repository nonce are not in agreement -- improve encryption trust HOT 1
- Are backup archive names encrypted? Cannot find answer in docs. HOT 1
- Backups much slower (5 mins compared to 0.3 secs) than reported "Duration" -- any way to speed it up? HOT 6
- Possible bug in pruning logic with keep-weekly and keep-monthly HOT 7
- netbsd9 vagrant box: broken libxxhash.pc HOT 2
- locking.py seems multiprocess-safe but not thread-safe HOT 3
- `borg check` hangs after errors HOT 5
- pytest startdir: py.path.local argument is deprecated
- Getting "Data integrity error: Invalid segment entry size 0" on fresh repos HOT 9
- Breaking change between b7 and b8 for encrypted repos HOT 5
- --pattern having different outcome in crontab HOT 6
- 2.0.0b5 repositories inaccessible with 2.0.0b8 - KeyError: 'type' in repoobj.py HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from borg.