You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A failed derive removes a delta file another image was already recorded on #211
Found by model checking (the Quint specs in #206). A counterexample in the model, each step read in the code at e281a48. Not reproduced on a running system.
Where:lib/hyper/img.ex:249-257 (record_derived_or_rollback/4). record_or_rollback/5 at img.ex:311-319 has the same shape for base images.
Chain:
Fork A publishes delta bytes D over parent P1. publish/2 creates the file, origin :created.
Fork B publishes the same bytes D over parent P2. The file exists, origin :reused, and B's record_derived/3 commits.
A's record_derived/3 fails. In the model P1 is being deleted, so a chain row fails its foreign key.
A's rollback removes the file with File.rm, under no lock and with no reference check.
Trigger: narrow. It needs two publishes of byte-identical content, one of which fails to record.
Read in the code, not modelled:publish/2 (img.ex:334-348) is exists-then-rename, so two publishers of the same bytes can both get :created. Its cross-device path (img.ex:358-367) copies straight to the final name and removes it when the copy fails, which a reuser may already have seen.
Model:image_store_shared_delta violates layersHaveFiles. The trace, from spec/ on that branch after npm ci:
Repro: not written. With real connections (the :external image tests commit for real): hold a transaction that deletes one parent's image and blob rows, start create_derived/4 over that parent, run a second create_derived/4 with the same delta bytes over another parent to completion, commit the first transaction, and check the delta file.
Activity