Record each snapshot's new chunk size when its backup runs #359

Merged
clawbot merged 1 commits from issue-311-new-chunk-size into next 2026-10-13 16:44:15 +02:00
Collaborator

Fixes #311.

snapshot list worked out NEW CHUNK SIZE from the snapshot's file rows in the local index. A file's row is shared by every snapshot that lists it and rewritten when the file changes, so earlier snapshots appeared to hold a changed file's new chunks: the snapshot with the change showed 0 B, and older snapshots' figures moved after each later backup.

The scanner now totals the size of the chunks it stores that were not stored before (the same chunks chunk_count counts). The backup writes that total to a new snapshots column, new_chunk_size, and snapshot list reads it instead of querying the file rows. docs/DATAMODEL.md and the README's snapshot list description say so.

The new test backs up a tree, changes one file, backs up again and compares the second snapshot's figure with the chunks the change added; it then changes the file again, backs up a third time, and checks that neither earlier figure moved.

Judgement call: the figure is now fixed when the backup runs. Before, it was measured against the earlier snapshots still in the local index, so removing one (for example with --prune --keep-newer-than) raised a later snapshot's figure; it no longer does.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/vaultik/issues/311. `snapshot list` worked out NEW CHUNK SIZE from the snapshot's file rows in the local index. A file's row is shared by every snapshot that lists it and rewritten when the file changes, so earlier snapshots appeared to hold a changed file's new chunks: the snapshot with the change showed `0 B`, and older snapshots' figures moved after each later backup. The scanner now totals the size of the chunks it stores that were not stored before (the same chunks `chunk_count` counts). The backup writes that total to a new `snapshots` column, `new_chunk_size`, and `snapshot list` reads it instead of querying the file rows. `docs/DATAMODEL.md` and the README's `snapshot list` description say so. The new test backs up a tree, changes one file, backs up again and compares the second snapshot's figure with the chunks the change added; it then changes the file again, backs up a third time, and checks that neither earlier figure moved. Judgement call: the figure is now fixed when the backup runs. Before, it was measured against the earlier snapshots still in the local index, so removing one (for example with `--prune --keep-newer-than`) raised a later snapshot's figure; it no longer does. Model: opus-5-5
clawbot added the needs-review label 2026-10-13 15:03:48 +02:00
clawbot self-assigned this 2026-10-13 15:03:48 +02:00
clawbot added 1 commit 2026-10-13 15:03:49 +02:00
snapshot list worked out NEW CHUNK SIZE from the snapshot's file rows. A
file's row is shared by every snapshot that lists it and rewritten when
the file changes, so a snapshot whose change was a modified file showed
0 B, and older snapshots' figures moved after later backups.

The scanner now totals the size of the chunks it stores that were not
stored before (the chunks chunk_count counts), the backup writes that
total to a new snapshots column, new_chunk_size, and snapshot list reads
it.

Judgement call: the figure is fixed when the backup runs, so removing an
earlier snapshot no longer raises a later snapshot's figure.

Model: opus-5-5
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit bffd4578fc into next 2026-10-13 16:44:15 +02:00
clawbot deleted branch issue-311-new-chunk-size 2026-10-13 16:44:15 +02:00
Sign in to join this conversation.