Upload a snapshot of a thumbnail shard, never the live file

Every shard is in WAL mode and every put opens its own connection, so
while thumbnails are being generated on several threads — which is when
the first sync pass runs — the log is never checkpointed and the main
file holds whatever the last quiet moment left in it. For a shard created
seconds earlier that is nothing: a zero-byte file with the schema still
in the log. The sync read that file and uploaded it, and every other
device merging it failed with "no such table: thumbs" on every pass.

Copy the shard through SQLite's backup API into scratch first, which
serialises against writers and carries the log, and upload that.
This commit is contained in:
2026-09-20 00:21:14 +02:00
parent 0fa9003e54
commit 7fba28f7d8
4 changed files with 89 additions and 15 deletions
+4 -4
View File
File diff suppressed because one or more lines are too long