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

8544 commits

Author SHA1 Message Date
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
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
TW
e7533944ad
Merge pull request #8315 from ThomasWaldmann/cleanups-master
remove outdated comment, fixes #4240
2024-08-02 21:30:30 +02:00
Ruben Rodriguez
6978584de6
docs: align /etc/backups path in all references 2024-08-01 15:31:38 +02:00
Thomas Waldmann
3a5ee93401
remove outdated comment, fixes #4240 2024-07-31 15:25:54 +02:00
TW
6039349932
Merge pull request #8312 from dtugend/doc-TIMESPAN
Add TIMESPAN to doc
2024-07-31 10:57:17 +02:00
Dominik Tugend
e715b9f5af Add TIMESPAN to doc
- Closes borgbackup/borg#8310
2024-07-30 23:49:50 +02:00
TW
364eb87ae2
Merge pull request #8286 from pktiuk/patch-1
Add Open Collective to FUNDING.yml
2024-07-27 00:37:42 +02:00
Thomas Waldmann
69ce4bd9ee
add github sponsors
also: reorder
2024-07-26 23:51:36 +02:00
TW
929c642b6e
Merge pull request #8304 from ThomasWaldmann/improve-healing-test-master
improve borg check --repair healing tests, see #8302
2024-07-23 22:31:46 +02:00
Thomas Waldmann
c6f95de492
improve borg check --repair healing tests, see #8302
test the healing more thoroughly:
- preservation of correct chunks list in .chunks_healthy
- check that .chunks_healthy is removed after healing
- check that doing another borg check --repair run does not find
  something to heal, again.

also did a datatype consistency fix for item.chunks_healthy list
members: they are now post processed in the same way as item.chunks,
so they have type ChunkListEntry rather than simple tuple.
2024-07-23 20:49:24 +02:00
TW
83aed450e9
Merge pull request #8293 from ThomasWaldmann/rel200b9
Release 2.0.0b9
2024-07-20 18:34:55 +02:00
Thomas Waldmann
84e87239bc
fix pypi repo name in upload script
it needs to be like this to support a ~/.pypirc like this,
containing a separate upload token for the borgbackup project:

[distutils]
index-servers =
    borgbackup
    ...

[borgbackup]
repository = https://upload.pypi.org/legacy/
username = __token__
password = pypi-...(token)...
2024-07-20 17:47:59 +02:00
Thomas Waldmann
7aabe8204c
fix binary_archiver tests for modern exit codes 2024-07-20 00:39:37 +02:00
Paweł Kotiuk
f777263997 Add Open Collective and Liberapay to FUNDING.yml
Source: https://www.borgbackup.org/support/fund.html
2024-07-19 20:41:06 +00:00
Thomas Waldmann
edfca29b97
build_usage / build_man 2024-07-19 20:40:15 +02:00
Thomas Waldmann
6778f2976a
update CHANGES 2024-07-19 20:39:32 +02:00
TW
4fe94bf77e
Merge pull request #8291 from ThomasWaldmann/key-export-filename-master
key export fixes (master)
2024-07-19 20:32:53 +02:00
Thomas Waldmann
4e6238e7d3
key export: fix exception handling
export_paperkey also must not get an already existing directory.
2024-07-19 19:55:14 +02:00
Thomas Waldmann
5eecdfa133
key export: fix crash when no path is given
In this case, the export functions output to stdout.

Also: add a note why this code is needed.
2024-07-19 19:48:25 +02:00
Thomas Waldmann
6211a3dc79
key export: move examples to docs 2024-07-19 19:44:38 +02:00
TW
4312a74c33
Merge pull request #8290 from ThomasWaldmann/modern-exit-codes-by-default
make BORG_EXIT_CODES="modern" the default, fixes #8110
2024-07-19 19:03:13 +02:00
Thomas Waldmann
ecddbc6691
make BORG_EXIT_CODES="modern" the default. 2024-07-19 17:31:36 +02:00