Conversation
| if include_data: | ||
| yield tag, key, offset, data | ||
| else: | ||
| yield tag, key, offset, size | ||
| yield tag, key, offset, size - header_size(tag) # corresponds to len(data) | ||
| assert size >= 0 |
There was a problem hiding this comment.
i changed this so that it either returns the data (so caller could do len(data)) or it does not return the data, but precisely len(data) without any header overheads.
There was a problem hiding this comment.
if callers now want the size with overhead, they add header_size(tag) again.
| if self._write_fd is not None: | ||
| # without this, we have test failure now | ||
| self._write_fd.sync() |
There was a problem hiding this comment.
this was needed now to avoid a test failure.
otherwise it could not read the MAGIC back from a recently created segment file.
There was a problem hiding this comment.
This is done a bit more than necessary, sufficient would be:
self._write_fd.f.flush()
But this is not available yet via SyncFile api.
Codecov Report
@@ Coverage Diff @@
## master #6689 +/- ##
==========================================
+ Coverage 82.59% 82.61% +0.01%
==========================================
Files 39 39
Lines 10746 10762 +16
Branches 2115 2121 +6
==========================================
+ Hits 8876 8891 +15
+ Misses 1345 1343 -2
- Partials 525 528 +3
Continue to review full report at Codecov.
|
…ries This saves some segment file random IO that was previously necessary just to determine the size of to be deleted data. Keep old one as NSIndex1 for old borg compatibility. Choose NSIndex or NSIndex1 based on repo index layout from HashHeader. for an old repo index repo.get(key) returns segment, offset, None, None
this fixes a strange test failure that did not happen until now: it could not read the MAGIC bytes from a (quite new) segment file, it just returned the empty string. maybe its appearance is related to the removed I/O calls.
|
will redo this against borg2 branch. #6705 |
improvements:
csize) andextrato the repo index