aiidateam / disk-objectstore

An implementation of an efficient "object store" (actually, a key-value store) writing files on disk and not requiring a running server
https://disk-objectstore.readthedocs.io
MIT License
15 stars 8 forks source link

Fix to the hash calculation when writing to compressed packs. #74

Closed giovannipizzi closed 4 years ago

giovannipizzi commented 4 years ago

The hasher was applied in the wrong place (while writing rather than while reading) therefore it was hashing after compression and storing with the wrong hash. The hasher should run on the read stream instead.

We fix this and we also add tests. We also add a validation while packing loose objects, so we avoid to pack files that are corrupt (rasing an Exception).

Fixes #73

codecov[bot] commented 4 years ago

Codecov Report

Merging #74 into develop will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##           develop       #74   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          982       987    +5     
=========================================
+ Hits           982       987    +5     
Impacted Files Coverage Δ
disk_objectstore/container.py 100.00% <100.00%> (ø)
disk_objectstore/utils.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 32baa14...d55603c. Read the comment docs.