1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-29 11:16:43 +00:00
Commit graph

8715 commits

Author SHA1 Message Date
Thomas Waldmann
a40978ae1b
blacken the code 2024-09-07 22:04:35 +02:00
Thomas Waldmann
ec1d89f477
compact: better stats
- compression factor
- dedup factor
- repo size

All values are approx. values without considering overheads.
2024-09-07 22:04:34 +02:00
Thomas Waldmann
c67cf07522
Repository.list: return [(id, stored_size), ...]
Note: LegacyRepository still returns [id, ...] and so does RemoteRepository.list,
if the remote repo is a LegacyRepository.

also: use LIST_SCAN_LIMIT
2024-09-07 22:03:56 +02:00
Thomas Waldmann
a15cd1e493
repository: remove __len__ and __contains__ 2024-09-07 22:01:21 +02:00
Thomas Waldmann
1a382a8bcf
set repository._location only 2024-09-07 22:01:19 +02:00
Thomas Waldmann
3408e942de
add sftp: / borgstore to quickstart docs 2024-09-07 22:01:18 +02:00
Thomas Waldmann
22b68b0199
add sftp: to repository url format docs 2024-09-07 22:01:16 +02:00
Thomas Waldmann
ec8a127b01
BORG_REPO env var: behave the same when unset or when set to empty string 2024-09-07 22:01:14 +02:00
Thomas Waldmann
7714b6542a
support sftp: repositories via borgstore 2024-09-07 22:01:12 +02:00
Thomas Waldmann
05739aaa65
refactor: rename repository/locking classes/modules
Repository -> LegacyRepository
RemoteRepository -> LegacyRemoteRepository
borg.repository -> borg.legacyrepository
borg.remote -> borg.legacyremote

Repository3 -> Repository
RemoteRepository3 -> RemoteRepository
borg.repository3 -> borg.repository
borg.remote3 -> borg.remote

borg.locking -> borg.fslocking
borg.locking3 -> borg.storelocking
2024-09-07 22:01:11 +02:00
Thomas Waldmann
84bd2b20d5
rcreate: refer to borgstore rather than filesystem directory 2024-09-07 22:01:09 +02:00
Thomas Waldmann
15e759c506
rcompress: fix help and comments
no "on-disk order" anymore.
2024-09-07 22:01:08 +02:00
Thomas Waldmann
8455c95003
info: do not output deduplicated_size
No precise refcounting, can't compute that inexpensively.
2024-09-07 22:01:06 +02:00
Thomas Waldmann
0b85b1a8bd
parseformat: remove dsize and unique_chunks placeholder
We don't have precise refcounts, thus we can't compute these.
2024-09-07 22:01:04 +02:00
Thomas Waldmann
c5023da729
transfer: rather talk of presence than refcount 2024-09-07 22:01:02 +02:00
Thomas Waldmann
20c180c317
debug: remove refcount-obj command
borg doesn't do precise refcounting anymore, so this is pretty useless.
2024-09-07 22:01:01 +02:00
Thomas Waldmann
2be98c773b
check: update comment / help 2024-09-07 22:01:00 +02:00
Thomas Waldmann
d9f24def6a
remove unused remote.RepositoryServer 2024-09-07 22:00:59 +02:00
Thomas Waldmann
e23231b2c4
remove Repository3.commit
didn't do anything anyway in this implementation.
2024-09-07 22:00:56 +02:00
Thomas Waldmann
5e3f2c04d5
remove archive checkpointing
borg1 needed this due to its transactional / rollback behaviour:
if there was uncommitted stuff in the repo, next repo opening automatically
rolled back to last commit. thus we needed checkpoint archives to reference
chunks and commit the repo.

borg2 does not do that anymore, unused chunks are only removed when the
user invokes borg compact.

thus, if a borg create gets interrupted, the user can just run borg create
again and it will find some chunks are already in the repo, making progress
even if borg create gets frequently interrupted.
2024-09-07 22:00:54 +02:00
Thomas Waldmann
c2890efdd1
docs: update the repository filesystem docs
In the end, it will all depend on the borgstore backend that will be used,
so we better point to the borgstore project for details.
2024-09-07 22:00:52 +02:00
Thomas Waldmann
5c325e3254
repository3.list: more efficient implementation 2024-09-07 22:00:50 +02:00
Thomas Waldmann
68e64adb9f
cache: add log msg to _load_chunks_from_repo
For big repos, this might take a while, so at least have messages on debug level.
2024-09-07 22:00:49 +02:00
Thomas Waldmann
6605f588cf
remove the repository.flags call / feature
this heavily depended on having a repository index where the flags get stored.

we don't have that with borgstore.
2024-09-07 22:00:48 +02:00
Thomas Waldmann
60edc8255f
repository/repository3: remove .scan method
This was an implementation specific "in on-disk order" list method that made sense
with borg 1.x log-like segment files only.

But we now store objects separately, so there is no "in on-disk order" anymore.
2024-09-07 22:00:46 +02:00
Thomas Waldmann
1189fc3495
debug dump-repo-objs: remove --ghost
This was used for an implementation detail of the borg 1.x
repository code, dumping uncommitted objects. Not needed any more.

Also remove local repository method scan_low_level, it was only used by --ghost.
2024-09-07 22:00:45 +02:00
Thomas Waldmann
bfbf3ba7aa
repository3.check: implement --repair
Tests were a bit tricky as there is validation on 2 layers now:
- repository3 does an xxh64 check, finds most corruptions already
- on the archives level, borg also does an even stronger cryptographic check
2024-09-07 22:00:43 +02:00
Thomas Waldmann
cb9ff3b490
fuse/mount code and test fixes 2024-09-07 22:00:41 +02:00
Thomas Waldmann
3e7a4cd814
make ruff happy 2024-09-07 22:00:40 +02:00
Thomas Waldmann
1231c961fb
blacken the code 2024-09-07 22:00:39 +02:00
Thomas Waldmann
d59306f48b
rinfo: remove size stats related docs, not shown any more 2024-09-07 22:00:38 +02:00
Thomas Waldmann
dcde48490e
remove CacheStatsMixin 2024-09-07 22:00:36 +02:00
Thomas Waldmann
fc6d459875
cache: replace .stats() by a dummy
Dummy returns all-zero stats from that call.

Problem was that these values can't be computed from the chunks cache
anymore. No correct refcounts, often no size information.

Also removed hashindex.ChunkIndex.summarize (previously used by the above mentioned
.stats() call) and .stats_against (unused) for same reason.
2024-09-07 22:00:35 +02:00
Thomas Waldmann
0306ba9a63
get rid of the CacheSynchronizer
Lots of low-level code written back then to optimize runtime of some
functions.

We'll solve this differently by doing less stats, esp. if it is expensive to compute.
2024-09-07 22:00:33 +02:00
Thomas Waldmann
7a93890602
archive.calc_stats: remove unique size computation 2024-09-07 22:00:32 +02:00
Thomas Waldmann
d6a70f48f2
remove LocalCache
Note: this is the default cache implementation in borg 1.x,
it worked well, but there were some issues:

- if the local chunks cache got out of sync with the repository,
  it needed an expensive rebuild from the infos in all archives.
- to optimize that, a local chunks.archive.d cache was used to
  speed that up, but at the price of quite significant space needs.

AdhocCacheWithFiles replaced this with a non-persistent chunks cache,
requesting all chunkids from the repository to initialize a simplified
non-persistent chunks index, that does not do real refcounting and also
initially does not have size information for pre-existing chunks.

We want to move away from precise refcounting, LocalCache needs to die.
2024-09-07 22:00:31 +02:00
Thomas Waldmann
4c052cd65d
delete: just remove archive from manifest, let borg compact clean up later.
much faster and easier now, similar to what borg delete --force --force used to do.

considering that speed, no need for checkpointing anymore.

--stats does not work that way, thus it was removed. borg compact now shows some stats.
2024-09-07 22:00:29 +02:00
Thomas Waldmann
17ea118155
check: remove orphan chunks detection/cleanup
This is now done in borg compact, so borg check does not need to care.
2024-09-07 22:00:28 +02:00
Thomas Waldmann
8ef517161d
compact: reimplement "borg compact" as garbage collection
It also outputs some statistics and warns about missing/reappeared chunks.
2024-09-07 22:00:27 +02:00
Thomas Waldmann
8c2cbdbb55
compact: remove "borg compact", not needed any more
All chunks are separate objects in borgstore.
2024-09-07 22:00:25 +02:00
Thomas Waldmann
c292ee25c5
rcompress: use get/put_manifest 2024-09-07 22:00:24 +02:00
Thomas Waldmann
b637542dcf
repository3/manifest: tests reenabled, fixes 2024-09-07 22:00:23 +02:00
Thomas Waldmann
8b9c052acc
manifest: store archives separately one-by-one into archives/*
repository:
- api/rpc support for get/put manifest
- api/rpc support to access the store
2024-09-07 22:00:21 +02:00
Thomas Waldmann
72d0caeb6b
locking3: store-based repo locking
Features:
- exclusive and non-exclusive locks
- acquire timeout
- lock auto-expiry (after 30mins of inactivity), lock refresh
- use tz-aware datetimes (in utc timezone) in locks

Also:
- document lock acquisition rules in the src
- increased default BORG_LOCK_WAIT to 10s
- better document with-lock test

Stale locks are ignored and automatically deleted.
Default: stale == 30 Minutes old.

lock.refresh() can be called frequently to avoid that an acquired lock becomes stale.
It does not do much if the last real refresh was recently.
After stale/2 time it checks and refreshes the locks in the store.

Update the repository3 code to call refresh frequently:
- get/put/list/scan
- inside check loop
2024-09-07 22:00:20 +02:00
Thomas Waldmann
c740fd718b
transfer: fix upgrades from borg 1.x by adding a --from-borg1 option
borg transfer is primarily a general purpose archive transfer function
from borg2 to related borg2 repos.

but for upgrades from borg 1.x, we also need to support:
- rcreate with a borg 1.x "other repo"
- transfer with a borg 1.x "other repo"
2024-09-07 22:00:17 +02:00
TW
ffd1280d5b
Merge pull request #8345 from ThomasWaldmann/py313
Python 3.13
2024-08-29 14:31:05 +02:00
Thomas Waldmann
a8381673b0
support / test on Python 3.13 2024-08-29 00:00:52 +02:00
Thomas Waldmann
d95cacd624
implement Repository3.check
It uses xxh64 hashes of the meta and data parts to verify their validity.
On a server with borg, this can be done server-side without the borg key.

The new RepoObj header has meta_size, data_size, meta_hash and data_hash.
2024-08-23 23:55:12 +02:00
Thomas Waldmann
d30d5f4aec
Repository3 / RemoteRepository3: implement a borgstore based repository
Simplify the repository a lot:

No repository transactions, no log-like appending, no append-only, no segments,
just using a key/value store for the individual chunks.

No locking yet.

Also:

mypy: ignore missing import
there are no library stubs for borgstore yet, so mypy errors without that option.

pyproject.toml: install borgstore directly from github
There is no pypi release yet.

use pip install -e . rather than python setup.py develop
The latter is deprecated and had issues installing the "borgstore from github" dependency.
2024-08-23 23:55:09 +02:00
TW
ea718b98f2
Merge pull request #8314 from ruben-rodriguez/master
docs: align /etc/backups path references in automated backups deployment guide
2024-08-02 21:31:19 +02:00