Closed ThomasWaldmann closed 1 week ago
There can be similar issues if multiple borg create
run in parallel: the last one updating the cache wins and knowledge about existing chunks (which were added by the other borg create
runs) might go away, leading to a future slowdown.
It never leads to corruption though, because only borg compact
removes chunks (and it uses an exclusive lock while working).
Without the cache, that all would be way simpler. Pity that listing all repo objects takes so long that we need a cache.
Some ideas about how to solve this:
chunks
cache from the repository, chunks.*
are merged into the in-memory ChunkIndex, written back to chunks
and then chunks.<SAME>
are removed.borg create
should write new/dirty chunk index entries to repository/cache/chunks.<RANDOM_OR_HASH>
periodically and afterwards mark them with F_CLEAN in memory.borg compact
builds a new chunk index from scratch and must remove all old cached chunk indexes and write an uptodate chunks
.Even easier, compared to previous post:
borg create
in parallel.note: this refers only to the chunk index, so borg will "know" what chunks are in the repo.
the files cache is currently only saved at the end, so that can still be a problem.
From https://github.com/borgbackup/borg/discussions/8451#discussioncomment-11066110 :
borg 2.0.0b12
There's an issue with the ChunkIndex cache if a connection breaks down: