Propagate CompressedDigest/CompressedSize when reusing data from another layer#2583
Conversation
b65f9aa to
3e936e1
Compare
For my own edification it'd be awesome if you can elaborate on why we do this somewhere |
|
The c/storage data model is designed to work on not just overlay, but snapshot systems. (In the worst case, device-mapper snapshots, although that backend was recently completely removed. Relevant today: the VFS driver creates layers by first copying all files from the parent into the child.) In that model, a layer can only be applied on top of its “original” parent, it can’t be assembled on top of some other parent. (That conceptual model is also demonstrated by the API shape, where |
3e936e1 to
560ddea
Compare
560ddea to
a826a75
Compare
a826a75 to
91d2dbc
Compare
4e2e3ac to
c35514f
Compare
bd375cc to
ef22323
Compare
…her layer We record (some) CompressedDigest/CompressedSize when pulling a layer from registry; but, previously, we would lose these values (and record uncompressed values) when creating a duplicate of a layer already present in storage. Eventually, the original layer might get deleted and then we would only find a match in BlobInfoCache, under more restrictive conditions. Instead, try to propagate the value to the duplicated layer. This might not work if the layer has multiple compressed representations, but that's hopefully not all _that_ frequent. Signed-off-by: Miloslav Trmač <mitr@redhat.com>
ef22323 to
8a9d3b9
Compare
We record (some)
CompressedDigest/CompressedSizewhen pulling a layer from registry; but, previously, we would lose these values (and record uncompressed values) when creating a duplicate of a layer already present in storage. Eventually, the original layer might get deleted and then we would only find a match inBlobInfoCache, under more restrictive conditions.Instead, try to propagate the value to the duplicated layer. This might not work if the layer has multiple compressed representations, but that's hopefully not all that frequent.
This activates the other half of containers/storage#1830 .