The locally defined preload() function overwrites the preload boolean keyword
argument, always evaluating to true, so preloading is done, even when not
requested by the caller, causing a memory leak.
Also move its definition outside of the loop.
This issue was found by Antonio Larrosa in borg issue #5202.
the old test stumbled over files with an empty chunks list,
so I guess just having some empty file in src/borg could make
that test fail.
fixed this by deleting a chunk of some specific file (we use
this file / this construction at misc. other places in the
archiver tests).
This patch is a quick fix for an inefficient seek algorithm used in read() function:
1) On each read call chunk list for given file is regenerated.
2) Finding needed chunk takes a lot of time for large offsets.
For 64 Gb files read speed drops to 16 MB/s, for 128 Gb - to 8 MB/s, and so on.
After applying this patch read speed becomes 270 MB/s, and does not depend on read position inside file.
Co-authored-by: Thomas Waldmann <tw@waldmann-edv.de>
the problem was that after a resize that was triggered by too few
empty buckets, the rebuilt new hash table had entries at different
positions than before, but the idx where to SET the entry was not
recomputed afterwards.
if an old hints file gets converted to the new format and it
has entries referring to non-existent segment files, a crash
occurred.
with this code, the crash is avoided and the erroneous hints
entry is removed.
Looks like the minimum requirement for correct operations
on ARMv6 in non-fixup mode is xxhash 0.7.2.
note: this does not compile due to the experimental stuff in xxh3.h.
support platforms with no os.link, fixes#4901
if we don't have os.link, we just extract another copy instead of making a hardlink.
for that to work, we need to have (and keep) the chunks list in hardlink_masters.
check: improve error output for matching index size, see #4829
if the rebuilt index size matched the on-disk index size AND there
was a difference in e.g. 1 key, the old code only output the key/value
for one index, but not what is present in the other index.
we already had better code in the branch for different index sizes,
so just use that for both cases.
additionally we tell when the index size matches (new) because we
also tell if there is a mismatch.
The code used for error reporting crashes due to an invalid utf-8
sequence. Use errors='replace' to never crash there. Errors
are expected in input data when borg check is run.