snapshot list shows a NEW CHUNK SIZE of 0 B for a snapshot whose change is a modified file #311

Closed
opened 2026-10-13 00:47:14 +02:00 by clawbot · 1 comment
Collaborator

Found by the defect hunt in #288 (part 1).

What is wrong: the local index keeps one file row per path, shared by every snapshot and rewritten in place when the file changes, so earlier snapshots appear to reference the new chunks. GetSnapshotNewChunkSize (internal/database/snapshots.go) therefore never counts new data from changed files, and older snapshots' figures change after later backups.

How it was shown: 50 bytes changed in a 5 MB file, then a backup: the run uploaded a 1.3 MB blob, and snapshot list showed that snapshot's NEW CHUNK SIZE as 0 B.

Definition of done

  • A snapshot's NEW CHUNK SIZE counts the chunks it added that no earlier snapshot held, including chunks of a modified file, and a later backup does not change it.
  • A test covers a modified file and checks the figure again after a later backup.

Model: opus-5-5

Found by the defect hunt in https://git.eeqj.de/sneak/vaultik/issues/288 (part 1). **What is wrong:** the local index keeps one file row per path, shared by every snapshot and rewritten in place when the file changes, so earlier snapshots appear to reference the new chunks. `GetSnapshotNewChunkSize` (`internal/database/snapshots.go`) therefore never counts new data from changed files, and older snapshots' figures change after later backups. **How it was shown:** 50 bytes changed in a 5 MB file, then a backup: the run uploaded a 1.3 MB blob, and `snapshot list` showed that snapshot's NEW CHUNK SIZE as `0 B`. **Definition of done** - A snapshot's NEW CHUNK SIZE counts the chunks it added that no earlier snapshot held, including chunks of a modified file, and a later backup does not change it. - A test covers a modified file and checks the figure again after a later backup. Model: opus-5-5
clawbot self-assigned this 2026-10-13 00:47:14 +02:00
Author
Collaborator

Fixed in #359: each backup now records the total size of the chunks it stored that were not stored before, in a new snapshots column new_chunk_size, and snapshot list shows that instead of working it out from the shared file rows. A test changes a file between backups and checks that each snapshot's figure is right and does not move after a later backup.

Model: opus-5-5

Fixed in https://git.eeqj.de/sneak/vaultik/pulls/359: each backup now records the total size of the chunks it stored that were not stored before, in a new `snapshots` column `new_chunk_size`, and `snapshot list` shows that instead of working it out from the shared file rows. A test changes a file between backups and checks that each snapshot's figure is right and does not move after a later backup. Model: opus-5-5
Sign in to join this conversation.