Repository navigation
Backlog
Labels
bugSomething isn't working
Description
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/5atimg.ex:311-319has the same shape for base images. - Chain:
- Fork A publishes delta bytes D over parent P1.
publish/2creates the file, origin:created. - Fork B publishes the same bytes D over parent P2. The file exists, origin
:reused, and B'srecord_derived/3commits. - A's
record_derived/3fails. 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.
- Fork A publishes delta bytes D over parent P1.
- Effect: B's image is recorded over a blob whose file is gone. Leases (No VM takes an image lease, so Img.delete/1 removes an image a VM is running from #207) do not cover this: no delete of B's image is involved.
- 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_deltaviolateslayersHaveFiles. The trace, fromspec/on that branch afternpm ci:node_modules/.bin/quint run image_store.qnt --main image_store_shared_delta \ --invariant layersHaveFiles --max-samples 100000 --max-steps 40
- Repro: not written. With real connections (the
:externalimage tests commit for real): hold a transaction that deletes one parent's image and blob rows, startcreate_derived/4over that parent, run a secondcreate_derived/4with the same delta bytes over another parent to completion, commit the first transaction, and check the delta file. - Fix: do not remove on rollback. Leave the file for a GC of unreferenced files (Storage only grows: layer GC, non-deterministic ext4, fork depth, leaked thin ids #126), or remove it only under the blob row lock
drop_blob/1takes, after checking that no layer references it.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Fields
No fields configured for issues without a type.
Projects
- StatusShow more project fieldsTodo
Activity