fix(convert): reserve the photos still writing, keep photo ids out of the job row, never copy a source twice

Stage A's space guard reserved, before each photo, only that photo and the
ones after it, so at the end of a sequence it counted a single photo while
up to twice the parallelism were still converting: a volume filling
meanwhile could go into the reserve. It now reserves the photo and every
photo started whose converted file has not landed yet (a file lands whole,
by a rename, before it is verified), so nothing in flight is missed and
nothing landed is counted twice, at the end of a sequence as anywhere.

The confirmed photo ids (about 21 MB for a million photos) lived in the
job's parameters, read by every dry run's busy check, by each sequence turn
of the conversion and by the job lists. They are now written whole, under a
job id chosen before the job is queued, into convert-<job>.photos beside
the journal, and go with it; the row keeps each sequence's digest, so the
job still converts exactly the photos confirmed (without the file, the
whole plan made again must match). The busy check reads only ids, kinds and
targets (and a verify's parameters), never the asking job's row; a
conversion's turn reads only its creation time; the server's job list and
dashboard and the engine's queue peeks read jobs without parameters.

A retried New sequence conversion could make a second copy. The journal now
names the copy as soon as its photos are filed; a retry finishes that copy
whatever changed in the source since, never remakes one deleted since, and
needs no space again for what it holds; and a source another conversion
copied in the same format after this one was confirmed is done with, with
no copy made (new outcome Superseded, with its job log line).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Alby96andClaude Opus 5.5 committed 2026-11-03 09:36:00 +01:00
1 parent b471a33bfc
commit 8ea25228eb
14 files changed
+966 -201

No files matched your search

+1
View File
@@ -224,6 +224,7 @@
<data name="Archive.Log.ConvertFailed" xml:space="preserve"><value>Left as it was: {0}. {1}</value><comment>long: job log line; {0} sequence title, {1} what failed and why (sentences)</comment></data>
<data name="Archive.Log.ConvertLeftOut" xml:space="preserve"><value>{0}: photos not converted, left in the source alone: {1}</value><comment>long: job log line after a conversion into a new sequence; {0} sequence title, {1} photos</comment></data>
<data name="Archive.Log.ConvertNothing" xml:space="preserve"><value>Nothing to convert: {0}</value><comment>long: job log line; {0} sequence title</comment></data>
<data name="Archive.Log.ConvertSuperseded" xml:space="preserve"><value>{0}: another conversion made its copy in this format since this one was confirmed; no second copy is made.</value><comment>long: job log line of a conversion into new sequences; {0} sequence title</comment></data>
<data name="Archive.Log.Converted" xml:space="preserve"><value>{0}: photos replaced by their conversion: {1}</value><comment>long: job log line; {0} sequence title, {1} photos</comment></data>
<data name="Archive.Log.ConvertedNew" xml:space="preserve"><value>{0}: photos converted into a new sequence: {1}</value><comment>long: job log line; {0} sequence title, {1} photos</comment></data>
<data name="Archive.Log.DryRun" xml:space="preserve"><value>Dry run: nothing was changed.</value><comment>long: job log line</comment></data>
+1
View File
@@ -218,6 +218,7 @@
<data name="Archive.Log.ConvertFailed" xml:space="preserve"><value>Lasciata com'era: {0}. {1}</value></data>
<data name="Archive.Log.ConvertLeftOut" xml:space="preserve"><value>{0}: foto non convertite, rimaste solo nella sorgente: {1}</value></data>
<data name="Archive.Log.ConvertNothing" xml:space="preserve"><value>Niente da convertire: {0}</value></data>
<data name="Archive.Log.ConvertSuperseded" xml:space="preserve"><value>{0}: dopo la conferma di questa conversione, un'altra ne ha già creato la copia in questo formato; non ne viene creata una seconda.</value></data>
<data name="Archive.Log.Converted" xml:space="preserve"><value>{0}: foto sostituite dalla loro conversione: {1}</value></data>
<data name="Archive.Log.ConvertedNew" xml:space="preserve"><value>{0}: foto convertite in una nuova sequenza: {1}</value></data>
<data name="Archive.Log.DryRun" xml:space="preserve"><value>Simulazione: nulla è stato modificato.</value></data>