DataONEorg / hashstore-java

HashStore, a hash-based object store for DataONE data packages
Apache License 2.0
1 stars 0 forks source link

deleteObject and deleteMetadata have different behaviors #79

Closed taojing2002 closed 3 months ago

taojing2002 commented 3 months ago

When some bad things happen, and Metacat tries to erase both the object and system metadata from HashStore, it calls deleteObject and deleteMetadata. It turns out that the deleteObject method keep the directory structure but delete the object file even though the directory is empty. But the deleteMetadata method will delete both directories and system metadata file. So the directory structure looks like:

hashstore/objects/8f/17/3d/
hashstore/metadata/
hashstore/refs/cids/8f/17/3d/
hashstore/refs/pids/9e/b3/9b/
doulikecookiedough commented 3 months ago

After discussing with Jing, it appears that in the described situation above, the client (Metacat) had not attempted to store any metadata. This explains why no subdirectories exist under /metadata. There already exists a junit test which covers this potential issue - so no action is needed at this time. I am closing this issue and will* re-open if we see this behaviour with further testing.