What was wrong: when a finished blob was already at the destination, snapshot create skipped the upload, but the blob row in the local index kept the size of the local copy, and the manifest and the snapshot's database took it from there. If compression_level or the recipients changed since the stored object was written, the two sizes can differ, and then shallow and deep snapshot verify failed on a good snapshot and the listed sizes were wrong.
What changed: marking a blob uploaded (UpdateUploaded) now also writes its compressed_size, taken from the object in storage: the size Stat reports when the upload is skipped, the size just written otherwise. uploadBlobIfNeeded returns that size. docs/DATAMODEL.md says what compressed_size holds after upload.
TestVerifyPassesWhenBackupReusesStoredBlob backs up a file, backs it up again from an empty local index with an extra recipient, and runs shallow and deep verify on the second snapshot.
Judgement call: the test adds a recipient instead of changing the compression level, because an extra age recipient always makes the local copy larger, while two zstd levels need not compress the test data differently.
Not changed: the "already exists ... Skipping upload" line and its log record still print the local copy's size.
Model: opus-5-5
Fixes https://git.eeqj.de/sneak/vaultik/issues/300.
**What was wrong:** when a finished blob was already at the destination, `snapshot create` skipped the upload, but the blob row in the local index kept the size of the local copy, and the manifest and the snapshot's database took it from there. If `compression_level` or the recipients changed since the stored object was written, the two sizes can differ, and then shallow and deep `snapshot verify` failed on a good snapshot and the listed sizes were wrong.
**What changed:** marking a blob uploaded (`UpdateUploaded`) now also writes its `compressed_size`, taken from the object in storage: the size `Stat` reports when the upload is skipped, the size just written otherwise. `uploadBlobIfNeeded` returns that size. `docs/DATAMODEL.md` says what `compressed_size` holds after upload.
`TestVerifyPassesWhenBackupReusesStoredBlob` backs up a file, backs it up again from an empty local index with an extra recipient, and runs shallow and deep verify on the second snapshot.
- Judgement call: the test adds a recipient instead of changing the compression level, because an extra age recipient always makes the local copy larger, while two zstd levels need not compress the test data differently.
- Not changed: the "already exists ... Skipping upload" line and its log record still print the local copy's size.
Model: opus-5-5
docs/DATAMODEL.md (the compressed_size line) and the new TODO.md entry say the stored object's size differs from the local copy's whenever the compression level or the recipients changed. It only can differ: replacing a recipient with another of the same kind gives the same size, and two compression levels can compress the same data to the same size, as the PR body itself says. Acceptable: "can differ" in both places, as the UpdateUploaded comment already says.
The branch conflicts with current next in TODO.md only (two Completed Steps entries at the same spot). Acceptable: rebased onto next with both entries kept, this PR's on top.
Unverified: make check on the branch rebased onto current next, and the test suite with the fix reverted; the shared build lock stayed taken for four hours. That the new test fails without the fix was checked by reading the code only.
Model: opus-5-5
- `docs/DATAMODEL.md` (the `compressed_size` line) and the new `TODO.md` entry say the stored object's size differs from the local copy's whenever the compression level or the recipients changed. It only can differ: replacing a recipient with another of the same kind gives the same size, and two compression levels can compress the same data to the same size, as the PR body itself says. Acceptable: "can differ" in both places, as the `UpdateUploaded` comment already says.
- The branch conflicts with current `next` in `TODO.md` only (two Completed Steps entries at the same spot). Acceptable: rebased onto `next` with both entries kept, this PR's on top.
Unverified: `make check` on the branch rebased onto current `next`, and the test suite with the fix reverted; the shared build lock stayed taken for four hours. That the new test fails without the fix was checked by reading the code only.
Model: opus-5-5
When a finished blob already existed at the destination, the upload was
skipped but the blob row, and so the manifest, kept the size of the
local copy. That copy can differ from the stored object when
compression_level or the recipients changed since it was written, and
then shallow and deep verify failed on a good snapshot. Marking a blob
uploaded now records the size of the object in storage: for an existing
blob, the size Stat reports.
Judgement call: the test adds a recipient rather than changing the
compression level, because an extra age recipient always makes the
local copy larger, while two zstd levels need not compress the test
data differently.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Fixes #300.
What was wrong: when a finished blob was already at the destination,
snapshot createskipped the upload, but the blob row in the local index kept the size of the local copy, and the manifest and the snapshot's database took it from there. Ifcompression_levelor the recipients changed since the stored object was written, the two sizes can differ, and then shallow and deepsnapshot verifyfailed on a good snapshot and the listed sizes were wrong.What changed: marking a blob uploaded (
UpdateUploaded) now also writes itscompressed_size, taken from the object in storage: the sizeStatreports when the upload is skipped, the size just written otherwise.uploadBlobIfNeededreturns that size.docs/DATAMODEL.mdsays whatcompressed_sizeholds after upload.TestVerifyPassesWhenBackupReusesStoredBlobbacks up a file, backs it up again from an empty local index with an extra recipient, and runs shallow and deep verify on the second snapshot.Model: opus-5-5
docs/DATAMODEL.md(thecompressed_sizeline) and the newTODO.mdentry say the stored object's size differs from the local copy's whenever the compression level or the recipients changed. It only can differ: replacing a recipient with another of the same kind gives the same size, and two compression levels can compress the same data to the same size, as the PR body itself says. Acceptable: "can differ" in both places, as theUpdateUploadedcomment already says.nextinTODO.mdonly (two Completed Steps entries at the same spot). Acceptable: rebased ontonextwith both entries kept, this PR's on top.Unverified:
make checkon the branch rebased onto currentnext, and the test suite with the fix reverted; the shared build lock stayed taken for four hours. That the new test fails without the fix was checked by reading the code only.Model: opus-5-5
e8ed3d0c27tobfebf3d0c0bfebf3d0c0toc5bcd49b03View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.