fix(archive): Reorganize checks each step before it moves, holds a failed plan, recovers file renames safely
Owner review 2, phase 4a review findings on the renamer. - File rename recovery is safe to run again from wherever it stopped: once every file is at its temporary name the journal says phase 2, as Run does, so a second recovery (after a failure, a crash or a sidecar that could not be written) never moves a file that reached its new name. A new name something else took meanwhile is never written over: that photo and its companions go back to their old names, or to the first free _2, _3, recorded in the journal before they move, and the frame names where its photo is. A journal is never deleted while a temporary file of it is still there. - Every check that can refuse a step runs under the step's leases before anything of it moves: where its sequences are, strangers inside, its new folder taken since the plan (a restore, an upload), a sidecar of a newer format, a title edited since the plan (compare-and-set against the planned from-title, sidecar and index), and its file renames, compared by a digest of every move at the planned frames version (a verify that hashes photos does not bump the version). Once the folder moved, every index row follows it before any file is renamed, and a photo in use or files found changed keep their names: the step completes. - The same checks run up front for a held plan, so its retry either fits or is given up. - A failed move job holds its plan, as a pause does: an archive open no longer applies the rest unasked; only the job's retry does. File renames a step left half-way are still completed at an archive open. - Each sequence changed is told as its step is journaled, so a pause or a failure never keeps it untold; the plan's journal keeps the tally of every run, so the job log counts the whole plan. - A selected sequence deleted while the job waited is named in the log and the plan refused with the localized stale-plan error, not a raw ArgumentException. - The dry run renames no file of a newer-format sidecar. New log lines and error (en, it): title and file names kept, file names kept because a photo was in use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 1d1c888120edd709dbb5341c1922bf85085c4857)
This commit is contained in:
1 parent
44e5b9da9e
commit
13c2ac321c
10 files changed
+961
-135
No files matched your search
@@ -82,6 +82,8 @@
|
||||
<data name="Archive.Error.NewerFormat" xml:space="preserve"><value>{0} è stato scritto da un Chronos più recente (formato {1}).</value></data>
|
||||
<data name="Archive.Error.Offline" xml:space="preserve"><value>L'archivio {0} non è raggiungibile.</value></data>
|
||||
<data name="Archive.Error.ReadOnly" xml:space="preserve"><value>L'archivio {0} è di sola lettura.</value></data>
|
||||
<data name="Archive.Error.ReorganizeBusy.one" xml:space="preserve"><value>{0:N0} sequenza ha mantenuto i nomi dei file: una foto era in uso.</value></data>
|
||||
<data name="Archive.Error.ReorganizeBusy.other" xml:space="preserve"><value>{0:N0} sequenze hanno mantenuto i nomi dei file: una foto era in uso.</value></data>
|
||||
<data name="Archive.Error.ReorganizeKept.one" xml:space="preserve"><value>{0:N0} sequenza non è stata riorganizzata come previsto: è cambiata dopo il piano.</value></data>
|
||||
<data name="Archive.Error.ReorganizeKept.other" xml:space="preserve"><value>{0:N0} sequenze non sono state riorganizzate come previsto: sono cambiate dopo il piano.</value></data>
|
||||
<data name="Archive.Error.SourceChanged" xml:space="preserve"><value>{0} è cambiato dopo la creazione del piano.</value></data>
|
||||
@@ -150,7 +152,9 @@
|
||||
<data name="Archive.Log.ProxiesDone" xml:space="preserve"><value>{0}: create {1}, riusate {2}, illeggibili {3}, in attesa {4}</value></data>
|
||||
<data name="Archive.Log.ProxiesSent" xml:space="preserve"><value>Proxy per il server: {0} inviati, {1} non inviati</value></data>
|
||||
<data name="Archive.Log.ReorganizeDropped" xml:space="preserve"><value>Lasciata com'era, cambiata dopo il piano: {0}</value></data>
|
||||
<data name="Archive.Log.ReorganizeFilesBusy" xml:space="preserve"><value>Nomi dei file mantenuti, una foto era in uso: {0}</value></data>
|
||||
<data name="Archive.Log.ReorganizeFilesKept" xml:space="preserve"><value>Nomi dei file mantenuti, foto cambiate dopo il piano: {0}</value></data>
|
||||
<data name="Archive.Log.ReorganizeTitleKept" xml:space="preserve"><value>Titolo e nomi dei file mantenuti, cambiata dopo il piano: {0}</value></data>
|
||||
<data name="Archive.Log.Reorganized" xml:space="preserve"><value>Sequenze cambiate: {0}, file rinominati: {1}</value></data>
|
||||
<data name="Archive.Log.ReorganizedEarlier" xml:space="preserve"><value>La riorganizzazione è stata completata all'apertura dell'archivio</value></data>
|
||||
<data name="Archive.Log.ReportOnly" xml:space="preserve"><value>Solo resoconto: nulla è stato modificato.</value></data>
|
||||
|
||||
Reference in new issue
Block a user