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

use borgstore and other big changes #8332

Merged
merged 79 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
d30d5f4
Repository3 / RemoteRepository3: implement a borgstore based repository
ThomasWaldmann Aug 4, 2024
d95cacd
implement Repository3.check
ThomasWaldmann Aug 7, 2024
c740fd7
transfer: fix upgrades from borg 1.x by adding a --from-borg1 option
ThomasWaldmann Aug 8, 2024
72d0cae
locking3: store-based repo locking
ThomasWaldmann Aug 10, 2024
8b9c052
manifest: store archives separately one-by-one into archives/*
ThomasWaldmann Aug 12, 2024
b637542
repository3/manifest: tests reenabled, fixes
ThomasWaldmann Aug 12, 2024
c292ee2
rcompress: use get/put_manifest
ThomasWaldmann Aug 12, 2024
8c2cbdb
compact: remove "borg compact", not needed any more
ThomasWaldmann Aug 12, 2024
8ef5171
compact: reimplement "borg compact" as garbage collection
ThomasWaldmann Aug 13, 2024
17ea118
check: remove orphan chunks detection/cleanup
ThomasWaldmann Aug 13, 2024
4c052cd
delete: just remove archive from manifest, let borg compact clean up …
ThomasWaldmann Aug 13, 2024
d6a70f4
remove LocalCache
ThomasWaldmann Aug 13, 2024
7a93890
archive.calc_stats: remove unique size computation
ThomasWaldmann Aug 13, 2024
0306ba9
get rid of the CacheSynchronizer
ThomasWaldmann Aug 13, 2024
fc6d459
cache: replace .stats() by a dummy
ThomasWaldmann Aug 13, 2024
dcde484
remove CacheStatsMixin
ThomasWaldmann Aug 14, 2024
d59306f
rinfo: remove size stats related docs, not shown any more
ThomasWaldmann Aug 14, 2024
1231c96
blacken the code
ThomasWaldmann Aug 14, 2024
3e7a4cd
make ruff happy
ThomasWaldmann Aug 14, 2024
cb9ff3b
fuse/mount code and test fixes
ThomasWaldmann Aug 14, 2024
bfbf3ba
repository3.check: implement --repair
ThomasWaldmann Aug 17, 2024
1189fc3
debug dump-repo-objs: remove --ghost
ThomasWaldmann Aug 17, 2024
60edc82
repository/repository3: remove .scan method
ThomasWaldmann Aug 18, 2024
6605f58
remove the repository.flags call / feature
ThomasWaldmann Aug 18, 2024
68e64ad
cache: add log msg to _load_chunks_from_repo
ThomasWaldmann Aug 19, 2024
5c325e3
repository3.list: more efficient implementation
ThomasWaldmann Aug 20, 2024
c2890ef
docs: update the repository filesystem docs
ThomasWaldmann Aug 20, 2024
5e3f2c0
remove archive checkpointing
ThomasWaldmann Aug 22, 2024
e23231b
remove Repository3.commit
ThomasWaldmann Aug 22, 2024
d9f24de
remove unused remote.RepositoryServer
ThomasWaldmann Aug 22, 2024
2be98c7
check: update comment / help
ThomasWaldmann Aug 23, 2024
20c180c
debug: remove refcount-obj command
ThomasWaldmann Aug 23, 2024
c5023da
transfer: rather talk of presence than refcount
ThomasWaldmann Aug 23, 2024
0b85b1a
parseformat: remove dsize and unique_chunks placeholder
ThomasWaldmann Aug 23, 2024
8455c95
info: do not output deduplicated_size
ThomasWaldmann Aug 23, 2024
15e759c
rcompress: fix help and comments
ThomasWaldmann Aug 23, 2024
84bd2b2
rcreate: refer to borgstore rather than filesystem directory
ThomasWaldmann Aug 23, 2024
05739aa
refactor: rename repository/locking classes/modules
ThomasWaldmann Aug 23, 2024
7714b65
support sftp: repositories via borgstore
ThomasWaldmann Aug 24, 2024
ec8a127
BORG_REPO env var: behave the same when unset or when set to empty st…
ThomasWaldmann Aug 24, 2024
22b68b0
add sftp: to repository url format docs
ThomasWaldmann Aug 24, 2024
3408e94
add sftp: / borgstore to quickstart docs
ThomasWaldmann Aug 24, 2024
1a382a8
set repository._location only
ThomasWaldmann Aug 24, 2024
a15cd1e
repository: remove __len__ and __contains__
ThomasWaldmann Aug 24, 2024
c67cf07
Repository.list: return [(id, stored_size), ...]
ThomasWaldmann Aug 26, 2024
ec1d89f
compact: better stats
ThomasWaldmann Aug 27, 2024
a40978a
blacken the code
ThomasWaldmann Aug 27, 2024
5726890
upgrade black to 24.x
ThomasWaldmann Aug 27, 2024
d27b7a7
cache: remove transactions, load files/chunks cache on demand
ThomasWaldmann Aug 28, 2024
ef47666
cache/hashindex: remove decref method, don't try to remove chunks on …
ThomasWaldmann Aug 29, 2024
bafbf62
ArchiveChecker.verify_data: simplify / optimize
ThomasWaldmann Aug 29, 2024
266e6ca
ArchiveChecker: remove unused possibly_superseded code
ThomasWaldmann Aug 29, 2024
e9c42a7
ArchiveChecker: .rebuild_refcounts -> .rebuild_archives
ThomasWaldmann Aug 29, 2024
f9d2e68
ArchiveChecker: don't do precise refcounting here
ThomasWaldmann Aug 29, 2024
ccc84c7
cache: renamed .chunk_incref -> .reuse_chunk, boolean .seen_chunk
ThomasWaldmann Aug 29, 2024
ddf6812
ChunkIndex: remove .incref method
ThomasWaldmann Aug 29, 2024
15c7039
ChunkIndex: remove unused .merge method
ThomasWaldmann Aug 29, 2024
07ab6e0
hashindex types: remove some unused stuff
ThomasWaldmann Aug 29, 2024
e2aa9d5
build_chunkindex_from_repo: reduce code duplication
ThomasWaldmann Aug 29, 2024
551834a
rcompress: not supported for legacy repos
ThomasWaldmann Aug 29, 2024
86dc673
compact: fix dsize computation if wanted chunks are present in repo
ThomasWaldmann Aug 31, 2024
dc9fff9
locking: ignore+delete locks of dead processes
ThomasWaldmann Aug 31, 2024
60a592d
with-lock: refresh repo lock while subprocess is running, fixes #8347
ThomasWaldmann Aug 31, 2024
7bf0f47
check repository: implement --max-duration and checkpoints, fixes #6039
ThomasWaldmann Aug 31, 2024
1cd2f4d
locking: deal with potential auto-expire during suspend
ThomasWaldmann Aug 31, 2024
b14c050
rspace: manage reserved space in repository
ThomasWaldmann Sep 1, 2024
ace97fa
docs: updates / removing outdated stuff
ThomasWaldmann Sep 1, 2024
60e88ef
repository: catch store backend exception, re-raise as repo exception
ThomasWaldmann Sep 1, 2024
b82ced2
refactor: move archives related code from Manifest to Archives class
ThomasWaldmann Sep 5, 2024
b56c81b
manifest.archives: refactor api
ThomasWaldmann Sep 5, 2024
ef7dd76
manifest: no read-modify-write for borgstore archives list
ThomasWaldmann Sep 6, 2024
8412168
check: only write to repo if --repair is given
ThomasWaldmann Sep 6, 2024
0e183b2
shared locking for many borg commands
ThomasWaldmann Sep 6, 2024
a509a0c
locking: no traceback on lock timeout (expected)
ThomasWaldmann Sep 6, 2024
bc1f90b
check: do not create addtl. archives dir entries if we already have one
ThomasWaldmann Sep 7, 2024
682aedb
check --repair --undelete-archives: bring archives back from the dead
ThomasWaldmann Sep 7, 2024
7442cbf
update CHANGES
ThomasWaldmann Sep 7, 2024
b50ed04
build_usage / build_man
ThomasWaldmann Sep 7, 2024
3794e32
--append-only and --storage-quota are not supported (yet?)
ThomasWaldmann Sep 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/black.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
- uses: actions/checkout@v4
- uses: psf/black@stable
with:
version: "~= 23.0"
version: "~= 24.0"
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ jobs:
pip install -r requirements.d/development.txt
- name: Install borgbackup
run: |
# pip install -e .
python setup.py -v develop
pip install -e .
- name: run tox env
env:
XDISTN: "4"
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 23.1.0
rev: 24.8.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Main features
**Speed**
* performance-critical code (chunking, compression, encryption) is
implemented in C/Cython
* local caching of files/chunks index data
* local caching
* quick detection of unmodified files

**Data encryption**
Expand Down
64 changes: 57 additions & 7 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ This section provides information about security and corruption issues.
Upgrade Notes
=============

borg 1.2.x to borg 2.0
----------------------
borg 1.2.x/1.4.x to borg 2.0
----------------------------

Compatibility notes:

- this is a major "breaking" release that is not compatible with existing repos.

We tried to put all the necessary "breaking" changes into this release, so we
hopefully do not need another breaking release in the near future. The changes
were necessary for improved security, improved speed, unblocking future
improvements, getting rid of legacy crap / design limitations, having less and
simpler code to maintain.
were necessary for improved security, improved speed and parallelism,
unblocking future improvements, getting rid of legacy crap and design
limitations, having less and simpler code to maintain.

You can use "borg transfer" to transfer archives from borg 1.1/1.2 repos to
You can use "borg transfer" to transfer archives from borg 1.2/1.4 repos to
a new borg 2.0 repo, but it will need some time and space.

Before using "borg transfer", you must have upgraded to borg >= 1.2.6 (or
Expand Down Expand Up @@ -84,6 +84,7 @@ Compatibility notes:
- removed --nobsdflags (use --noflags)
- removed --noatime (default now, see also --atime)
- removed --save-space option (does not change behaviour)
- removed --bypass-lock option
- using --list together with --progress is now disallowed (except with --log-json), #7219
- the --glob-archives option was renamed to --match-archives (the short option
name -a is unchanged) and extended to support different pattern styles:
Expand Down Expand Up @@ -114,12 +115,61 @@ Compatibility notes:
fail now that somehow "worked" before (but maybe didn't work as intended due to
the contradicting options).


.. _changelog:

Change Log 2.x
==============

Version 2.0.0b10 (2024-09-09)
-----------------------------

TL;DR: this is a huge change and the first very fundamental change in how borg
works since ever:

- you will need to create new repos.
- likely more exciting than previous betas, definitely not for production.

New features:

- borgstore based repository, file:, ssh: and sftp: for now, more possible.
- repository stores objects separately now, not using segment files.
this has more fs overhead, but needs much less I/O because no segment
files compaction is required anymore. also, no repository index is
needed anymore because we can directly find the objects by their ID.
- locking: new borgstore based repository locking with automatic stale
lock removal (if lock does not get refreshed, if lock owner process is dead).
- simultaneous repository access for many borg commands except check/compact.
the cache lock for adhocwithfiles is still exclusive though, so use
BORG_CACHE_IMPL=adhoc if you want to try that out using only 1 machine
and 1 user (that implementation doesn't use a cache lock). When using
multiple client machines or users, it also works with the default cache.
- delete/prune: much quicker now and can be undone.
- check --repair --undelete-archives: bring archives back from the dead.
- rspace: manage reserved space in repository (avoid dead-end situation if
repository fs runs full).

Bugs/issues fixed:

- a lot! all linked from PR #8332.

Other changes:

- repository: remove transactions, solved differently and much simpler now
(convergence and write order primarily).
- repository: replaced precise reference counting with "object exists in repo?"
and "garbage collection of unused objects".
- cache: remove transactions, remove chunks cache.
removed LocalCache, BORG_CACHE_IMPL=local, solving all related issues.
as in beta 9, adhowwithfiles is the default implementation.
- compact: needs the borg key now (run it clientside), -v gives nice stats.
- transfer: archive transfers from borg 1.x need the --from-borg1 option
- check: reimplemented / bigger changes.
- code: got rid of a metric ton of not needed complexity.
when borg does not need to read borg 1.x repos/archives anymore, after
users have transferred their archives, even much more can be removed.
- docs: updated / removed outdated stuff


Version 2.0.0b9 (2024-07-20)
----------------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/changes_1.x.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3469,7 +3469,7 @@ Other changes:
- archiver tests: add check_cache tool - lints refcounts

- fixed cache sync performance regression from 1.1.0b1 onwards, #1940
- syncing the cache without chunks.archive.d (see :ref:`disable_archive_chunks`)
- syncing the cache without chunks.archive.d
now avoids any merges and is thus faster, #1940
- borg check --verify-data: faster due to linear on-disk-order scan
- borg debug-xxx commands removed, we use "debug xxx" subcommands now, #1627
Expand Down
2 changes: 1 addition & 1 deletion docs/deployment/automated-local.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ modify it to suit your needs (e.g. more backup sets, dumping databases etc.).
#

# Options for borg create
BORG_OPTS="--stats --one-file-system --compression lz4 --checkpoint-interval 86400"
BORG_OPTS="--stats --one-file-system --compression lz4"

# Set BORG_PASSPHRASE or BORG_PASSCOMMAND somewhere around here, using export,
# if encryption is used.
Expand Down
2 changes: 0 additions & 2 deletions docs/deployment/hosting-repositories.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ can be filled to the specified quota.
If storage quotas are used, ensure that all deployed Borg releases
support storage quotas.

Refer to :ref:`internals_storage_quota` for more details on storage quotas.

**Specificities: Append-only repositories**

Running ``borg init`` via a ``borg serve --append-only`` server will **not**
Expand Down
Loading
Loading